June 2020
Intermediate to advanced
382 pages
11h 39m
English
MD5 was developed by Poul-Henning Kamp in 1994 to replace MD4. It generates a 128-bit hash. MD5 is a relatively simple algorithm that is vulnerable to collision. In applications where a collision cannot be tolerated, MD5 should not be used.
Let's look at an example. In order to generate an MD5 hash in Python, we will use the passlib library, which one of the most popular open source libraries, implementing over 30 password-hashing algorithms. If it is not already installed on your device, install it by using the following code in a Jupyter notebook:
!pip install passlib
In Python, we can generate the MD5 hash as follows:
Note that MD5 generates a hash of 128 bits.
As mentioned, we can use this generated hash ...