हैश/क्रिप्टो
PBKDF2 Hash + Verify
पासवर्ड से PBKDF2 (RFC 8018), HMAC-SHA1/256/384/512 के ज़रिए डिराइव्ड की, अनुकूलनीय इटरेशन काउंट के साथ।
PBKDF2 (RFC 8018) applies HMAC to a password and salt repeatedly to deliberately slow down computation — it's the oldest of the standardized algorithms for password hashing and encryption key derivation.
How to use it
- Derive: enter a password, pick an HMAC algorithm (SHA-1/256/384/512), and set the iteration count to get a derived key of the requested length.
- Verify: paste a password and an existing PBKDF2 hash to check whether they match, without recomputing it manually.
- More iterations means slower, more secure computation — tune the value to your server's response-time budget.
Common uses
- Deriving an encryption key from a user's password for a file container or a custom protocol.
- Checking a PBKDF2 implementation for compatibility across programming languages (the parameters must match exactly).
- Hashing passwords in systems that require a FIPS-compliant algorithm (PBKDF2 is NIST-approved).
Things to keep in mind
Unlike bcrypt and Argon2, PBKDF2 isn't memory-hard — it only requires CPU time, so it's less resistant to attacks on GPUs with many parallel compute units.
The recommended iteration count rises over time in NIST and OWASP guidance as hardware gets faster — check against current recommendations periodically.
इस टूल के बारे में लेख: PBKDF2: की स्ट्रेचिंग का सबसे पुराना मानक
अक्सर पूछे जाने वाले प्रश्न
पासवर्ड हैशिंग के लिए PBKDF2, bcrypt या Argon2 से कैसे अलग है?
PBKDF2 ब्रूट-फोर्स को धीमा करने के लिए HMAC हैश फ़ंक्शन को बार-बार लागू करता है, लेकिन bcrypt या Argon2 के विपरीत यह मेमोरी-हार्ड नहीं है, इसलिए GPU से इसे क्रैक करना अपेक्षाकृत सस्ता है। यह अभी भी व्यापक रूप से इस्तेमाल होता है और FIPS-अनुमोदित है, लेकिन नए सिस्टम के लिए आमतौर पर Argon2 पसंद किया जाता है।
इटरेशन काउंट क्या नियंत्रित करता है, और यह कितना ऊंचा होना चाहिए?
इटरेशन काउंट तय करता है कि अंतर्निहित हैश कितनी बार लागू होता है, जो सीधे गति को ब्रूट-फोर्स प्रतिरोध से बदलता है। वर्तमान मार्गदर्शन SHA-256 के लिए सैकड़ों हज़ार इटरेशन की सलाह देता है, जिसे हार्डवेयर तेज़ होने पर समय के साथ बढ़ाया जाता है।
PBKDF2 को सॉल्ट की ज़रूरत क्यों है?
सॉल्ट यह सुनिश्चित करता है कि समान पासवर्ड अलग-अलग आउटपुट दें, जिससे हमलावर पहले से गणना की गई रेनबो टेबल का इस्तेमाल नहीं कर सकते और उन्हें हर हैश पर अलग से हमला करना पड़ता है।
क्या PBKDF2 किस बेस हैश फ़ंक्शन का इस्तेमाल करता है, इससे फ़र्क़ पड़ता है?
हाँ। पुराने इम्प्लीमेंटेशन अक्सर डिफ़ॉल्ट रूप से HMAC-SHA1 इस्तेमाल करते थे — HMAC की संरचना में यह गंभीर वल्नरेबिलिटी नहीं है, लेकिन मॉडर्न सिफ़ारिशें साफ़ तौर पर HMAC-SHA256 या उससे मज़बूत फ़ंक्शन की सलाह देती हैं ताकि बिना स्पीड में असरदार कमी के ज़्यादा सुरक्षा मार्जिन मिले।
पासवर्ड स्टोरेज के अलावा PBKDF2 और कहां इस्तेमाल होता है?
PBKDF2 का व्यापक इस्तेमाल पासवर्ड से क्रिप्टोग्राफ़िक एन्क्रिप्शन की डिराइव करने के लिए होता है — जैसे Wi-Fi के लिए WPA2/WPA3 में और कई एन्क्रिप्टेड फ़ाइल कंटेनर फ़ॉर्मेट में।