Questions tagged [md5sum]

md5sum is a computer program that calculates and verifies 128-bit MD5 hashes, as described in RFC 1321.

329 questions
254
votes
17 answers

Only get hash value using md5sum (without filename)

I use md5sum to generate a hash value for a file. But I only need to receive the hash value, not the file name. md5=`md5sum ${my_iso_file}` echo ${md5} Output: 3abb17b66815bc7946cefe727737d295 ./iso/somefile.iso How can I 'strip' the file name…
John Doe
  • 9,843
  • 13
  • 42
  • 73
159
votes
4 answers

How do I calculate the MD5 checksum of a file in Python?

I have written some code in Python that checks for an MD5 hash in a file and makes sure the hash matches that of the original. Here is what I have developed: # Defines filename filename = "file.exe" # Gets MD5 from file def getmd5(filename): …
user2344996
  • 1,643
  • 2
  • 12
  • 8
151
votes
16 answers

How can I calculate an MD5 checksum of a directory?

I need to calculate a summary MD5 checksum for all files of a particular type (*.py for example) placed under a directory and all sub-directories. What is the best way to do that? The proposed solutions are very nice, but this is not exactly what I…
victorz
  • 2,209
  • 4
  • 19
  • 15
115
votes
1 answer

Why is an MD5 hash created by Python different from one created using echo and md5sum in the shell?

A Python MD5 hash is different than the one created by the md5sum command on the shell. Why? >>> import hashlib >>> h = hashlib.md5() >>> h.update("mystringforhash") >>> print h.hexdigest() 86b6423cb6d211734fc7d81bbc5e11d3 # Result from Python $…
mailGO
  • 1,169
  • 2
  • 7
  • 4
103
votes
7 answers

Will changing a file name affect the MD5 Hash of a file?

Will changing a file name effect the MD5 Hash of a file?
Michael Shnitzer
  • 2,465
  • 6
  • 25
  • 34
63
votes
3 answers

Why do seemingly empty files and strings produce md5sums?

Consider the following: % md5sum /dev/null d41d8cd98f00b204e9800998ecf8427e /dev/null % touch empty; md5sum empty d41d8cd98f00b204e9800998ecf8427e empty % echo '' | md5sum 68b329da9893e34099c7d8ad5cb9c940 - % perl -e 'print chr(0)' |…
Daniel
  • 1,160
  • 1
  • 10
  • 16
37
votes
10 answers

Make .txt file unreadable / uneditable

I have a program which saves a little .txt file with a highscore in it: // Create a file to write to. string createHighscore = _higscore + Environment.NewLine; File.WriteAllText(path, createText); // Open the file to read from. string…
Daniel Kng
  • 786
  • 1
  • 9
  • 21
20
votes
2 answers

What are the differences between MD5 binary mode and text mode?

Here's my testing : ...$ md5sum -b roy.html f9283ca2833ff7ebb6781ab8d23a21aa *roy.html ...$ md5sum -t roy.html f9283ca2833ff7ebb6781ab8d23a21aa roy.html Is there any different between these two mode ?
WoooHaaaa
  • 19,732
  • 32
  • 90
  • 138
15
votes
4 answers

Java calculate MD5 hash

In http://www.anyexample.com/programming/java/java_simple_class_to_compute_md5_hash.xml an example is given how to calculate an MD5 hash of String. This results in a 20 digit hex string. According to http://en.wikipedia.org/wiki/MD5 I would expect a…
AndyAndroid
  • 4,039
  • 14
  • 44
  • 71
15
votes
3 answers

diff files comparing only first n characters of each line

I have got 2 files. Let us call them md5s1.txt and md5s2.txt. Both contain the output of a find -type f -print0 | xargs -0 md5sum | sort > md5s.txt command in different directories. Many files were renamed, but the content stayed the same. Hence,…
14
votes
6 answers

How to generate MD5 using VBScript in classic ASP?

I need to generate an MD5 in my application. I've tried google but only find PHP code for MD5. I need to connect to a client system that validates using MD5 hash but their code is in PHP, mine is in Classic ASP using VBScript. My server is .Net…
user1270384
  • 711
  • 7
  • 24
  • 53
9
votes
4 answers

Is there an MD5 Sum function in PL/SQL

In Oracle SQL, is there an MD5 function or something available to me? I would like to do something like... select name, md5_sum( name ) from person;
Bob Kuhar
  • 10,838
  • 11
  • 62
  • 115
9
votes
1 answer

How to calculate md5 checksum of blob using CryptoJS

Uploading file in chunks using Blob API. Here I want to check the md5 checksum of the blob. When I tried the below code it is working fine for text files, but it is returning different value for binary files. var reader = new…
Awesome
  • 5,689
  • 8
  • 33
  • 58
9
votes
4 answers

Golang md5 Sum() function

package main import ( "crypto/md5" "fmt" ) func main() { hash := md5.New() b := []byte("test") fmt.Printf("%x\n", hash.Sum(b)) hash.Write(b) fmt.Printf("%x\n",…
w00d
  • 5,416
  • 12
  • 53
  • 85
8
votes
4 answers

The MD5 from a local file and the MD5 (eTag) from S3 is not the same

I get the MD5 of a local file but it is different than the MD5 (eTag) of the "same" file in Amazon S3. What I would like to achieve is figure out if the lastest files I have in S3 is the same one that I have locally. If I cannot compare MD5, then…
oky_sabeni
  • 7,672
  • 15
  • 65
  • 89
1
2 3
21 22