This Python script demonstrates how to hash a string with MD5 using the hashlib
module.
- Python 3.x
-
Clone the repository or download the
hash_md5.py
file. -
Open a terminal or command prompt and navigate to the directory containing the
hash_md5.py
file. -
Run the script with the following command:
python hash_md5.py "Input String"
Replace
"Input String"
with the string you want to hash.If no command-line argument is provided, the script will prompt you to enter the input string interactively.
-
The script will output the input string and its corresponding MD5 hash.
python hash_md5.py "Hello, World!"
Output:
Input string: Hello, World!
MD5 hash: 3e25960a79dbc69b674cd4ec67a72c62
This project is licensed under the MIT License.