Questions tagged [md5]

Cryptographic hash function with a 128-bit (16-byte) hash value. MD5 is no longer considered a secure hash and should not be used to protect sensitive information like passwords

MD5 is incredibly weak on modern computers, and can be easily broken. If you are looking to securely hash values, consider something stronger like bcrypt

MD5 (Message-Digest algorithm 5) is a widely used cryptographic hash function with a 128-bit (16-byte) hash value. Specified in RFC 1321, MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of files. However, it has been shown that MD5 is not collision resistant; as such, MD5 is not suitable for applications like SSL certificates or digital signatures that rely on this property. An MD5 hash is typically expressed as a 32-digit hexadecimal number.

References:

4054 questions
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
156
votes
9 answers

Is MD5 still good enough to uniquely identify files?

Is MD5 hashing a file still considered a good enough method to uniquely identify it given all the breaking of MD5 algorithm and security issues etc? Security is not my primary concern here, but uniquely identifying each file is. Any thoughts?
Ranhiru Jude Cooray
  • 19,542
  • 20
  • 83
  • 128
146
votes
7 answers

Is calculating an MD5 hash less CPU intensive than SHA family functions?

Is calculating an MD5 hash less CPU intensive than SHA-1 or SHA-2 on "standard" laptop x86 hardware? I'm interested in general information, not specific to a certain chip. UPDATE: In my case, I'm interested in calculating the hash of a file. If…
Mick
  • 13,248
  • 9
  • 69
  • 119
144
votes
19 answers

How can I convert a String to an MD5 hash in iOS using Swift?

I want to convert a string like "abc" to an MD5 hash. I want to do this in iOS and Swift. I have tried using the solutions below but they were not working for me: Importing CommonCrypto in a Swift framework How to use CC_MD5 method in swift…
user3606682
  • 1,945
  • 3
  • 17
  • 24
140
votes
10 answers

Random hash in Python

What is the easiest way to generate a random hash (MD5) in Python?
mistero
  • 5,139
  • 8
  • 29
  • 27
138
votes
14 answers

PHP best way to MD5 multi-dimensional array?

What is the best way to generate an MD5 (or any other hash) of a multi-dimensional array? I could easily write a loop which would traverse through each level of the array, concatenating each value into a string, and simply performing the MD5 on the…
Peter John
  • 1,859
  • 4
  • 15
  • 14
136
votes
11 answers

SHA1 vs md5 vs SHA256: which to use for a PHP login?

I'm making a php login, and I'm trying to decide whether to use SHA1 or Md5, or SHA256 which I read about in another stackoverflow article. Are any of them more secure than others? For SHA1/256, do I still use a salt? Also, is this a secure way to…
Tony Stark
  • 24,588
  • 41
  • 96
  • 113
134
votes
5 answers

MD5 algorithm in Objective-C

How to calculate the MD5 in Objective-C?
Biranchi
  • 16,120
  • 23
  • 124
  • 161
131
votes
9 answers

MD5 is 128 bits but why is it 32 characters?

I read some docs about md5, it said that its 128 bits, but why is it 32 characters? I can't compute the characters. 1 byte is 8 bits if 1 character is 1 byte then 128 bits is 128/8 = 16 bytes right? EDIT: SHA-1 produces 160 bits, so how many…
hash_jr90
  • 1,313
  • 2
  • 9
  • 4
121
votes
13 answers

How to calculate md5 hash of a file using javascript

Is there a way to calculate the MD5 hash of a file before the upload to the server using Javascript?
LuRsT
  • 3,973
  • 9
  • 39
  • 51
121
votes
7 answers

Is there an MD5 Fixed Point where md5(x) == x?

Is there a fixed point in the MD5 transformation, i.e. does there exist x such that md5(x) == x?
Jack
115
votes
12 answers

How to generate an MD5 file hash in JavaScript/Node.js?

How to write functionToGenerateMD5hash for this code? I already have fileVideo and I need to send the corresponding md5 hash to the server by clicking on the button. $("#someButton").click(function() { var fr = new FileReader(); fr.onload =…
Taras Kravets
  • 1,443
  • 4
  • 14
  • 15
111
votes
12 answers

How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?

As I want to use Google maps in my application, I need the debug certificates' MD5 fingerprint. I tried following.: (Here I copied the debug.keystore file from C:\Documents and Settings\Administrator.android in bin folder) C:\Program…
Prachi Kshirsagar
  • 1,141
  • 2
  • 9
  • 5
111
votes
7 answers

SHA-256 or MD5 for file integrity

I know that SHA-256 is favored over MD5 for security, etc., but, if I am to use a method to only check file integrity (that is, nothing to do with password encryption, etc.), is there any advantage of using SHA-256? Since MD5 is 128-bit and SHA-256…
Dave
  • 8,163
  • 11
  • 67
  • 103
106
votes
12 answers

Can two different strings generate the same MD5 hash code?

For each of our binary assets we generate a MD5 hash. This is used to check whether a certain binary asset is already in our application. But is it possible that two different binary assets generate the same MD5 hash. So is it possible that two…
Lieven Cardoen
  • 25,140
  • 52
  • 153
  • 244