Skip to content

Latest commit

Β 

History

History
119 lines (79 loc) Β· 3.69 KB

README.md

File metadata and controls

119 lines (79 loc) Β· 3.69 KB

πŸ§™ Gandalf's Hash Cracker

A Python cybersecurity tool that generates and cracks cryptographic hashes using dictionary attacks β€” delivered with commentary from Gandalf the Grey. Built as part of a cybersecurity learning journey.


πŸ” What is a Hash?

When websites store your password they don't save it as plain text. Instead they run it through a hash function which converts it into a fixed string:

"gandalf" β†’ "ab17850978e36aaf6a2b8808f1ded971"

Hashing is a one-way process β€” you can't reverse a hash back to the original password. So how do hackers crack them? By hashing millions of common passwords and comparing the results. This is called a dictionary attack.


⚑ Features

Feature Description
Hash Generator Generate MD5, SHA1, SHA256, or SHA512 hashes from plain text
Hash Cracker Crack hashes using a wordlist dictionary attack
Auto Detection Automatically identifies hash type from its length
Wordlist Support Works with any wordlist β€” swap in millions-word lists for real cracking
Gandalf Mode In-character reactions from Gandalf for every operation

πŸ”‘ Supported Hash Types

Algorithm Length Security
MD5 32 chars ❌ Broken β€” never use for passwords
SHA1 40 chars ⚠️ Weak β€” deprecated
SHA256 64 chars βœ… Strong β€” widely used
SHA512 128 chars βœ… Very strong β€” maximum security

πŸ› οΈ Built With

Python


πŸš€ Usage

python hashcracker.py

Generate a hashChoose option 1

  1. Enter plain text (e.g. "gandalf")
  2. Select hash type (MD5, SHA1, SHA256, SHA512)
  3. Copy the generated hash

Example


πŸ“‹ Wordlist

The included wordlist.txt contains common passwords for testing including LOTR themed passwords. For real-world testing, replace it with larger wordlists like:

  • rockyou.txt β€” 14 million real leaked passwords, industry standard
  • SecLists β€” massive collection maintained by Daniel Miessler on GitHub
  • CrackStation β€” 1.5 billion word wordlist for serious cracking

⚠️ Larger wordlists = higher chance of cracking real world hashes


πŸ”‘ Key Concepts Learned

  • Cryptographic hashing β€” one way functions that can't be reversed
  • Hash length detection β€” every algorithm always produces the same length output
  • Dictionary attacks β€” hashing wordlist entries and comparing to target
  • Why MD5 is dangerous β€” designed for speed, making it easy to crack at scale
  • Real tools β€” this is a simplified version of Hashcat and John the Ripper
  • Defense β€” why bcrypt and Argon2 are better for passwords (intentionally slow)

⚠️ Legal Disclaimer

This tool is intended for educational purposes only. Only use on hashes you own or have explicit permission to crack. Unauthorized cracking of credentials is illegal.


πŸ”— Related Projects

A growing Python cybersecurity toolkit:

Tool Purpose
Hash Cracker Crack MD5/SHA hashes via dictionary attack
Password Checker Analyze password strength
Port Scanner Find open ports on a host
Ping Sweeper Discover live hosts on a network
Caesar Cipher Encrypt and decrypt messages

πŸ‘€ Author

Ryan β€” github.com/Patharx


"All secrets yield to knowledge and patience." πŸ§™