Skip to content
sourabh mane

project / 08Offensive security basics

SHA-1 Password Cracker

A Python dictionary attack against SHA-1 hashes, built to show how the attack works.

View source updated
Stack
  • Python
  • hashlib

Overview

Reads a wordlist line by line, hashes each candidate with SHA-1 and compares it to the target hash, stopping at the first match. Built for learning purposes.

Key features

  • Normalises the input hash (trim, lowercase)
  • Streams the wordlist rather than loading it into memory
  • Stops on the first match

Security concepts

  • Dictionary attacks
  • Password hashing (SHA-1)

Screenshots

Terminal output: one SHA-1 hash cracked to the password 'rohit', a second hash not found in the wordlist.
Two runs: one hash found in the wordlist, one not.

Notes

  • Educational use only.