YUNOVA · Ethical Hacking

Module 8: Passwords and hashing

Notes for offline study · 30 November 2026

How passwords are stored and hashed

Key points

  • अच्छा system password को plain text में नहीं रखता; वह उसका hash रखता है, यानी एक one-way fingerprint जिसे वापस original password में नहीं बदला जा सकता।
  • Salt = हर password के साथ जुड़ा random मान, जिससे एक जैसे passwords के hash अलग बनते हैं। इससे ready-made tables बेकार हो जाते हैं।
  • मज़बूत storage के लिए bcrypt, scrypt, Argon2 या PBKDF2 जैसे slow, purpose-built password hashing algorithms इस्तेमाल होते हैं।
  • Developers के लिए नियम: अपना hashing scheme खुद न बनाएँ, और user passwords को logs या database में plain text में कभी न रखें।

Hashing versus encryption

Key points

  • Hashing one-way है: data से fixed-size fingerprint बनता है और वापस original नहीं मिलता। Encryption two-way है: सही key से data वापस पढ़ा जा सकता है।
  • Hashing integrity जाँचने और passwords store करने के लिए है; encryption confidentiality, यानी data को छिपाकर रखने के लिए।
  • Passwords को encrypt करके नहीं, hash करके रखना चाहिए, क्योंकि key चोरी होने पर सारे encrypted passwords खुल जाएँगे।
  • आम गलती: encoding (जैसे Base64) को encryption समझना। Encoding में कोई secret key नहीं होती और वह सुरक्षा नहीं देती।

Cracking a hash you created with John and Hashcat

Key points

  • Password cracking tools जैसे John the Ripper और Hashcat security testers और defenders के जाने-माने tools हैं, जो यह जाँचते हैं कि password कितना कमज़ोर है।
  • इन्हें सिर्फ उन्हीं hashes पर इस्तेमाल करें जो आपने अपनी lab में खुद बनाए हों, या जिनकी जाँच की लिखित अनुमति हो। दूसरों के hashes पर यह गैरकानूनी है।
  • इससे सीख यह है कि कमज़ोर या छोटा password, तेज़ और बिना salt वाला hash जल्दी टूटता है, जबकि लंबा password और slow salted hash कहीं ज़्यादा मज़बूत रहता है।
  • Defender का नतीजा: लंबे passphrases, MFA, कमज़ोर या leaked passwords की जाँच और सही password hashing algorithm इस्तेमाल करें।

Wordlists

Key points

  • Wordlist = आम passwords और शब्दों की सूची। यह दिखाती है कि लोग अक्सर कितने अनुमानित passwords चुनते हैं।
  • Defenders इसी जानकारी का इस्तेमाल करते हैं: आम और leaked passwords की blocklist बनाकर, ताकि users ऐसे कमज़ोर passwords रख ही न पाएँ।
  • Account की सुरक्षा के लिए login पर lockout या rate limiting और MFA रखें, ताकि बार-बार अनुमान लगाने से कुछ हासिल न हो।
  • Wordlists सिर्फ अपनी lab या authorised password audit में इस्तेमाल करें, और नतीजों का उपयोग passwords सुधारने के लिए करें।

Why strong passwords and MFA defend against this

Key points

  • लंबा, अनोखा password या passphrase guessing और cracking दोनों को बहुत मुश्किल बना देता है। लंबाई, जटिलता से ज़्यादा काम आती है।
  • हर account के लिए अलग password रखें, ताकि एक site के leak से बाकी accounts सुरक्षित रहें। इसके लिए password manager मदद करता है।
  • MFA में password चोरी होने पर भी दूसरा factor चाहिए, इसलिए अकेला password पर्याप्त नहीं रहता। Authenticator app या hardware key SMS से बेहतर माने जाते हैं।
  • Organisations इसके साथ failed-login alerts, lockout या rate limiting और leaked-password checks भी लगाती हैं।

Free on YUNOVA · yunova.in · Sign in to add your own lesson notes to this sheet.

Notes: Passwords and hashing | YUNOVA