Questions tagged [hashsum]

Questions related to hashes, hash values or hash codes that are returned by hash functions such as SHA-1.

Filter by
Sorted by
Tagged with
171
votes
17answers
225k views

How do I get the MD5 sum of a directory's contents as one sum?

The md5sum program does not provide checksums for directories. I want to get a single MD5 checksum for the entire contents of a directory, including files in sub-directories. That is, one combined ...
83
votes
10answers
218k views

How to create SHA512 password hashes on command line

In Linux I can create a SHA1 password hash using sha1pass mypassword. Is there a similar command line tool which lets me create sha512 hashes? Same question for Bcrypt and PBKDF2.
30
votes
5answers
25k views

How can I get a base64 encoded shaX on the cli?

sha1sum outputs a hex encoded format of the actual sha. I would like to see a base64 encoded variant. possibly some command that outputs the binary version that I can pipe, like so: echo -n "message" |...
29
votes
2answers
51k views

/etc/shadow : how to generate $6$ 's encrypted password? [duplicate]

In /etc/shadow file there are encrypted password. Encrypted password is no longer crypt(3) or md5 "type 1" format. (according to this previous answer) Now I have a $6$somesalt$...
29
votes
3answers
9k views

Find a file when you know its checksum?

I have the md5sum of a file and I don't know where it is on my system. Is there any easy option of find to identify a file based on its md5? Or do I need to develop a small script ? I'm working on ...
28
votes
2answers
8k views

Why does the gzip version of files produce a different md5 checksum

I have four files that I created using an svndump test.svn test2.svn test.svn.gz test2.svn.gz now when I run this md5sum test2.svn test.svn test.svn.gz test2.svn.gz Here is the output ...
23
votes
6answers
8k views

Simultaneously calculate multiple digests (md5, sha256)?

Under the assumption that disk I/O and free RAM is a bottleneck (while CPU time is not the limitation), does a tool exist that can calculate multiple message digests at once? I am particularly ...
22
votes
2answers
2k views

md5sum prepends '\' to the checksum

Why md5sum is prepending "\" in front of the checksum when finding the checksum of a file with "\" in the name? $ md5sum /tmp/test\\test \d41d8cd98f00b204e9800998ecf8427e /tmp/test\\test The same ...
19
votes
6answers
51k views

generate consistent machine unique ID

Can we generate a unique id for each PC, something like uuuidgen, but it will never change unless there are hardware changes? I was thinking about merging CPUID and MACADDR and hash them to generate ...
19
votes
1answer
21k views

What methods are used to encrypt passwords in /etc/passwd and /etc/shadow?

A careful examination of the /etc/passwd and /etc/shadow files reveal that the passwords stored are hashed using some form of hashing function. A quick Google search reveals that by default, the ...
17
votes
7answers
6k views

How can I generate SHA3 if there is no sha3sum command in coreutils?

I have sha1sum or sha512sum on an average Linux distro. But where is the sha3sum command that can generateSHA-3 commands?
17
votes
2answers
1k views

Why do these duplicated SD cards have different sha1sums for their content?

I have a bunch of Class 10 UHS-1 SDHC SD cards from different manufacturers. They are all partitioned as follows $ sudo fdisk -l /dev/sdj Disk /dev/sdj: 14.9 GiB, 15931539456 bytes, 31116288 sectors ...
17
votes
3answers
19k views

Calculate md5sum of a CD/DVD

I have an ISO file, which I burned to a CD. Now how can I check if the CD is correctly created? I would like a command that calculate the hash sum that I can use to check with the hash sum I calculate ...
15
votes
1answer
16k views

Use md5sum to verify file in a script

I want to verify a file using md5sum -c file.md5. I can do that by hand, but I don't know how to check the validity in a script.
13
votes
3answers
24k views

Compute bcrypt hash from command line

I would like to compute the bcrypt hash of my password. Is there an open source command line tool that would do that ? I would use this hash in the Syncthing configuration file (even if I know from ...
12
votes
3answers
9k views

How to pipe md5 hash result in shell

I am looking for a simple way to pipe the result of md5sum into another command. Something like this: $echo -n 'test' | md5sum | ... My problem is that md5sum outputs not only the hash of the string,...
12
votes
1answer
4k views

md5sum command binary and text mode

The GNU md5sum command has two modes: binary mode and text mode. I guess the difference is only on how newline characters are handled? Am I right? On GNU/Linux, the two modes always produce same ...
11
votes
4answers
24k views

A simpler way of comparing md5 checksum?

After downloading a file that has a md5 checksum available I currently check it with md5 *file* | grep *given_checksum* e.g. md5 file.zip | grep -i B4460802B5853B7BB257FBF071EE4AE2 but it seemed ...
11
votes
4answers
8k views

how can a makefile detect whether a command is available in the local machine?

I began to use org-mode for planning out my tasks in GTD-style system. Putting every org files in a directory of a Dropbox folder, I run emacs to edit / manage these files from three different local ...
10
votes
3answers
7k views

check md5sum from pipe

I am confused how md5sum --check is supposed to work: $ man md5sum -c, --check read MD5 sums from the FILEs and check them I have a file, I can pipe it to md5sum: $ cat file | md5sum ...
10
votes
1answer
6k views

How to find the hashing algorithm used to hash passwords?

I have the working password and can see the hash (/etc/passwd). How do I find the hashing algorithm used to hash the password, without manually trying different algorithms until I find a match?
10
votes
5answers
1k views

find | xargs shasum creates checksum of checksum file itself (prematurely) and fails when checking

My problem (in a script with #!/bin/sh) is as follows: I try to checksum all files in a directory for archival purposes. The checksum (in my case sha1) file with all filenames should reside in the ...
10
votes
3answers
15k views

packer - ERROR: One or more PGP signatures could not be verified!

I'm trying to install ncurses5-compat-libs on Arch Linux with packer. But I get this error: ==> ERROR: One or more PGP signatures could not be verified! How can I fix it?
9
votes
3answers
7k views

No sha256sum in MacOS

I tried to use sha256sum in High Sierra; I attempted to install it with MacPorts, as: sudo port install sha256sum It did not work. What to do?
8
votes
4answers
28k views

Bash script detecting change in files from a directory

I am trying to make a script that detects if any of the files in a directory were changed within a 2 seconds interval. What I have so far is: #!/bin/bash for FILE in "${PWD}/*" do SUM1="$(md5sum $...
8
votes
1answer
588 views

Why does `md5sum` not give the same hash as the Internet does?

I want to find the md5 hash of the string "a", but running echo "a" | md5sum gives me another hash than what I get if I search the internet (for example using DuckDuckGo or the first search result I ...
8
votes
4answers
5k views

Suppress filename from output of sha512sum

Maybe it is a trivial question, but in the man page I didn't find something useful. I am using Ubuntu and bash. The normal output for sha512sum testfile is <hash_code> testfile How to ...
8
votes
5answers
11k views

How to remove duplicate files using bash

I have a folder with duplicate (by md5sum (md5 on a Mac)) files, and I want to have a cron job scheduled to remove any found. However, I'm stuck on how to do this. What I have so far: md5 -r * | ...
7
votes
5answers
641 views

Using pv with md5sum

I used md5sum with pv to check 4 GiB of files that are in the same directory: md5sum dir/* | pv -s 4g | sort The command completes successfully in about 28 seconds, but pv's output is all wrong. ...
7
votes
6answers
7k views

Change only one bit in a file

I have to test a hash function and I want to change only a single bit of a specific file. I tried with the dd command. That works, but I can only change a whole byte and not just a bit. sudo dd if=/...
7
votes
1answer
870 views

How to check a hash sum file on FreeBSD?

Situation I'm on FreeBSD 11.2 without GUI. I'm brand new to BSD systems. Suppose we have a SHA512SUM file generated on FreeBSD with: sha512 encrypt-file-aes256 decrypt-file-aes256 > SHA512SUM ...
6
votes
2answers
22k views

Does the hash of a file change if the filename changes?

Does the hash of a file change if the filename or path or timestamp or permissions change? $ echo some contents > testfile $ shasum testfile 3a2be7b07a1a19072bf54c95a8c4a3fe0cdb35d4 testfile
6
votes
3answers
12k views

MySQLdump via crontab - Pass --password=/hashed/password/file so I can use via crontab w/o using plain text password

So I'm setting up a WordPress backup guide/making a backup schedule for myself for real. I want to do MySQL dumps daily, but the command either requires -p then user input or --password="plain ...
6
votes
1answer
3k views

RIPEMD-160 file digest

How can I make a file digest under Linux with the RIPEMD-160 hash function, from the command line?
6
votes
4answers
592 views

Rename files based on checksum

I have a md5sum list and a lot of file which I wanted to checksum and then rename them according to the md5sum list. Example of the list: d4cd401ade018617629b39efed7b7be4 foo.bar ...
6
votes
1answer
663 views

How to make a list generated by md5deep in alphabetical order of relative paths?

If I want make a md5sum list recursively, then I would use md5deep, but it starts to pop up some problems such as it won't generate the md5sum file in alphabetical order. For example, $ cd /media/...
5
votes
4answers
7k views

is it possible to create a file given an md5 hash

I know this is a strange question, and I know that md5sum is nearly impossible to break... but I'm just wondering if someone here knows if it is possible to recreate a file given it's md5sum hash? I ...
5
votes
1answer
839 views

Tar produces different files each time

I often have large directories that I want to transfer to a local computer from a server. Instead of using recursive scp or rsync on the directory itself, I'll often tar and gzip it first and then ...
5
votes
3answers
1k views

Compute md5sum for each line in a file

Given a file like: a b c How do I get an output like: a 0cc175b9c0f1b6a831c399e269772661 b 92eb5ffee6ae2fec3ad71c777531578f c 4a8a08f09d37b73795649038408b5f33 in an efficient way?...
5
votes
1answer
1k views

How to create sha1 checksums of files inside a tar archive without using much disk space

I would like to get the sha1 checksums of all files inside a simple tar archive as a list, or a new file Without using the disk space to unpack the big tar file. Something with piping and calculating ...
5
votes
1answer
3k views

OSX: Generate MD5 checksum recursively in a textfile containing files with corresponding checksum

In a directory withmultiple subdirectories but only one folder deep containing tiff-files I'd like to generate a md5 checksum that writes the filename with the corresponding checksum into a textfile. ...
5
votes
2answers
483 views

Different hash value of large rsynced file on centos and ubuntu?

I rsynced a large file from remote centos to local ubuntu with rsync -avzP user@<remote-ip>:/path/to/file . It reported the transfer went well: sent 30 bytes received 257,293,476 bytes 1,...
5
votes
1answer
497 views

Using kernel cryptographic functions

Is it possible to use kernel cryptographic functions in the userspace? Let's say, I don't have md5sum binary installed on my system, but my kernel has md5sum support. Can I use the kernel function ...
4
votes
3answers
355 views

md5 sum in debian's official directory

Why there are 12 md5 sums while there are only 5 ISOs in Debian's official site? http://cdimage.debian.org/debian-cd/current/i386/iso-dvd/ I just download the debian-8.5.0-i386-DVD-1.iso and check ...
4
votes
3answers
2k views

How to rename multiple files to their contents' MD5 sum?

I would like to rename some files to their contents' MD5 sum; for example, if file foo is empty, it should be renamed to d41d8cd98f00b204e9800998ecf8427e. Does it have to be script or can I use ...
4
votes
3answers
2k views

How to delete duplicates of files in directory and subdirs?

Is there any fast method to delete duplicates of files based on any hash sum (i.e. SHA1 to be fast). Because I've got some mess in my music files.
4
votes
3answers
1k views

md5sum check (no file)

So I'm trying to check dozens of files using a shell script. The file check happens at different times. Is there a way to do this? md5sum -c 24f4ce42e0bc39ddf7b7e879a File.name or even better ...
4
votes
3answers
7k views

HDD image file checksum does not match with device checksum

I have a 660297728 byte HDD image with MD5 hash f5a9d398e974617108d26c1654fe7bcb: root@T42# ls -l image -rw-rw-r-- 1 noc noc 660297728 Sep 29 19:00 image root@T42# md5sum image ...
4
votes
3answers
4k views

using sed to replace pattern with hash values

I want to search the file and replace specific pattern with its hash (SHA1) values. For example, let file.txt has the following content: one S56G one two three four five V67X six and I want to ...
4
votes
1answer
799 views

Encrypt & obfuscate filenames

I am looking for a backup solution and while trying to anonymize and protect my data one of the problems I've found is that the filenames leak a lot of information. I am looking for a piece of ...