The tag has no usage guidance.

learn more… | top users | synonyms (2)

67
votes
10answers
73k 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 ...
39
votes
6answers
88k 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.
22
votes
3answers
3k 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 ...
20
votes
2answers
4k 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 ...
17
votes
6answers
4k 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 ...
16
votes
3answers
11k 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 ...
13
votes
5answers
9k 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" |...
13
votes
2answers
876 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 ...
13
votes
1answer
9k 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 ...
11
votes
5answers
15k 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 ...
10
votes
4answers
4k 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 ...
9
votes
5answers
530 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 ...
8
votes
3answers
6k 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 ...
7
votes
2answers
9k views

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

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$...
7
votes
1answer
475 views

Use md5sum to verify file in a script

This question is probably quite easy but I don't know how to accomplish this. 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 ...
6
votes
2answers
1k 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 ...
6
votes
1answer
319 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
2answers
12k 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 ...
5
votes
4answers
3k 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
1k views

RIPEMD-160 file digest

How can I make a file digest under Linux with the RIPEMD-160 hash function, from the command line?
4
votes
3answers
1k 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
2k 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
3answers
2k 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 * | ...
4
votes
1answer
50 views

Best way to programatically detect the current host (by hardware features)

I have a hard drive with a Linux installation on it that I like to boot from different physical computers. My question is whether it's possible to programmatically detect which computer the drive is ...
4
votes
1answer
420 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 ...
3
votes
3answers
629 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 ...
3
votes
4answers
426 views

Bash script detecting change in files from a directory

I am a beginner in bash scripting and 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 ...
3
votes
3answers
90 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 ...
3
votes
1answer
150 views

md5sum change after mount?

I have a ext3 filesystem on a .img file. After mounting and unmounting it, I noticed that the md5sum is changed, even if no file inside was changed! md5sum myfilesystem.img XXXX myfilesystem.img ...
3
votes
2answers
4k views

How to create a md5-file for every folder in a drive recursivley?

I'm searching for a script which creates a md5 chechsum file for every single folder inside drive recursivley? I do have a copy of md5deep on my machine but I'm not that good in scripting bash.
3
votes
2answers
525 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
3
votes
1answer
223 views

md5deep utility giving wrong/different output!

md5deep utility gives different result when calculating hashes. I have used several online tools to calculate hash and they give same result but md5sum or md5deep program on linux gives different ...
3
votes
1answer
1k 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 ...
3
votes
3answers
266 views

How do I easily update list of md5sums?

Sometimes I use an unreliable medium (flash) to store a good deal of data. To at least recognise bit flips I store a file with the md5sums alongside. This file is usually created by a variation of ...
3
votes
1answer
70 views

chpasswd and openssl

I'm trying to pass an MD5 password to chpasswd but it doesn't seem to work. echo username:$(openssl passwd -1 -salt salt password) Then I try to pass this to chpasswd to change the password echo '...
3
votes
2answers
1k views

Store password as hash in wpa_supplicant.conf? [duplicate]

This question is very much related to this one. I want to log into a user and password protected wifi which uses PEAP and maybe MS-CHAPv2. My wpa_supplicant.conf has to contain an entry like this: ...
3
votes
2answers
158 views

Help checking the integrity of TAR files for backup

I want make a backup of my Home directory and I've read a good method is to use the tar tool, and I think it suits me well since all I need to do is create a .tar of every folder in the Home directory ...
2
votes
3answers
297 views

Sanity checking MD5 sums

Do MD5 checksums contain a checkbit? I have to copy some MD5 checksums by hand (there's no other way) and was wondering whether there is any code out there that can validate a checksum as being valid ...
2
votes
3answers
83 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 ...
2
votes
3answers
62 views

find and md5sum not yielding any output (find -o limit?)

I ran into a situation that I don't really understand. I have a bunch of backup files in a recursive structure of which I want to calculate the md5. When I add some additional file extensions the ...
2
votes
2answers
1k views

Different MD5Sum for the same file in same directory

I find it odd as I managed to get different md5sum using the exact same file from the same directory. The output as below: [root@testlabs Config]# ls Backup_Files hostname1-config.uac hostname2-...
2
votes
3answers
2k views

How to find md5sum of files on remote machines by doing ssh?

I am running my below shell script on machineC which gets the md5sum of my files in my PRIMARY directory in machineC itself. #!/bin/bash export PRIMARY=/data01/primary for entry in "$PRIMARY"/* do ...
2
votes
3answers
823 views

Rename files with random characters from sha1sum. Will the names be unique?

I'm using this command to rename files with random characters from sha1sum and move all files from subdirectories to the current directory: for fname in `find . -type f`; do mv "$fname" $(echo "$...
2
votes
2answers
182 views

How to use md5sum for checksum with an md5 file which doesn't contain the filename

I have 2 files test.txt and test.txt.md5. I would like to verify the checksum of test.txt. The gnu tool md5sum requires an md5 file with the following format "[md5-hash][space][space][filename]" (...
2
votes
1answer
207 views

How to compute a thumbnail filename from the shell?

I started noticing some time ago in Xfce4 that when I sent some file to the Trash, tumbler (the Xfce4 thumbnailer) would cause very high I/O load for quite some time. Upon investigating the issue, I ...
2
votes
1answer
1k views

wpa_supplicant store password as hash (WPA-EAP with phase2=“auth=PAP”)

Is there a way to store my password in /etc/wpa_supplicant/wpa_supplicant.conf as some hash instead of plaintext? By "password" I refer here to the password used for phase2 authentification. I do not ...
2
votes
1answer
801 views

Trailing space when generating md5

I apologize if this has already been answered, or if the answer is simpler than I realize, but I can't seem to figure out the following: When I try to generate an md5 from a string, either with echo ...
2
votes
2answers
281 views

Replace all files with identical hash

I want to replace all files in a target path with the same name as original.file AND the same hash as orignal.file with new.file. What's the command to do this? Say I have updated the contents of a ...
2
votes
1answer
54 views

Clustering identical files ignoring spaces & linebreaks

Consider a folder with many XML files (10K small text files). Some XML files are identical, some are different. I would like to find out what files are identical (ignoring whitespaces, tabs and ...
2
votes
2answers
46 views

Burn fedora to DVD, but hash is incorrect

I downloaded Fedora-20-x86_64-DVD.iso from mirro site, and I checked the Sha256 with HashMyFiles, they are the same. But when I burned it to DVD, and checked the hash of DVD with Hash Codes, they are ...