CRYPTOGRAPHY
Module 1: Introduction to
Cryptography
Module 1 – Introduction to Cryptography
Demo 1 – Cracking passwords using John the Ripper
Problem Statement 1
Crack Linux Password using John the Ripper.
Solution
Command:
john /etc/shadow
The /etc/shadow file stored the actual passwords
Output:
Problem Statement 2
Crack password of a zip file using John the Ripper.
Solution
Step 1: Create a password protected zip file. You can skip this step if you already have a password protected
zip file
Command:
touch a.txt
zip -e a.zip a.txt
The -e option is used to add password to the zip file. Enter a password when prompted.
Output:
©Brain4ce Education Solutions Pvt. Ltd Page 1
Module 1 – Introduction to Cryptography
Step 2: Generate password hash from the zip file.
Command:
zip2john a.zip > pass.hashes
Output:
Step 2: Crack the password.
Command:
john pass.hashes
Output:
©Brain4ce Education Solutions Pvt. Ltd Page 2
Module 1 – Introduction to Cryptography
The password is 1234.
Problem Statement 3
Crack md5 hash stored in a text file.
Solution
Syntax:
john --format=raw-md5 <filename>
Command:
john --format=raw-md5 md5.txt
Output:
The password is computer.
© Brain4ce Education Solutions Pvt. Ltd.
©Brain4ce Education Solutions Pvt. Ltd Page 3