हैश/क्रिप्टो
HMAC Generator
सीक्रेट की के साथ टेक्स्ट या फ़ाइल का HMAC (Hash-based Message Authentication Code) कैलकुलेट करें — एक साथ आठ एल्गोरिदम में: MD5, SHA-1, SHA-256, SHA-384, SHA-512, SHA3-256, SHA3-512, RIPEMD-160।
HMAC (Hash-based Message Authentication Code) is a hash computed together with a secret key, proving a message hasn't changed and was sent by someone who knows that key. Unlike a plain hash, an HMAC can't be forged without knowing the secret.
How to use it
- Enter text or a file and a secret key — the HMAC is computed instantly with eight algorithms at once (MD5, SHA-1, SHA-2, SHA3, RIPEMD-160).
- Copy the variant you need to verify a signature or compare against an expected value.
- The same input and key always produce the same HMAC — handy for checking against a signature received from another system.
Common uses
- Verifying a webhook signature from a payment service or API (most sign the payload with HMAC-SHA256).
- Generating a request signature for an API that requires HMAC authentication.
- Debugging a mismatched signature — checking the key, input encoding, and algorithm one at a time.
Things to keep in mind
HMAC protects against tampering and confirms the sender's authenticity, but it doesn't encrypt the message itself — the content stays readable.
A mismatched HMAC is most often caused by different data encoding (e.g. JSON field order) or a stray whitespace or line break, not by a bug in the algorithm itself.
इस टूल के बारे में लेख: HMAC: की वाला हैश सामान्य हैश से कैसे अलग है
अक्सर पूछे जाने वाले प्रश्न
HMAC और सामान्य हैश में क्या अंतर है?
सामान्य हैश केवल यह साबित करता है कि डेटा बदला नहीं गया; HMAC इसके अतिरिक्त एक गुप्त कुंजी का उपयोग करता है, इसलिए यह इंटीग्रिटी के साथ-साथ यह भी साबित करता है कि भेजने वाले को साझा सीक्रेट पता था — बिना कुंजी के कोई भी वैध HMAC नहीं बना सकता, भले ही उसे एल्गोरिद्म पता हो।
HMAC के लिए कौन-सा हैश एल्गोरिद्म चुनना चाहिए?
HMAC-SHA256 एक मज़बूत आधुनिक डिफ़ॉल्ट है। पुराने विकल्प जैसे HMAC-MD5 या HMAC-SHA1 विशेष रूप से HMAC के रूप में अभी टूटे नहीं हैं, लेकिन नए सिस्टम के लिए SHA-256 या उससे मज़बूत की सलाह दी जाती है।
क्या मेरी गुप्त कुंजी कहीं भेजी जाती है?
नहीं। HMAC पूरी तरह आपके ब्राउज़र में Web Crypto API के ज़रिए गणना होती है — कुंजी और संदेश कभी आपके डिवाइस से बाहर नहीं जाते।
HMAC की तुलना सामान्य इक्वलिटी ऑपरेटर से क्यों नहीं करनी चाहिए?
सामान्य स्ट्रिंग तुलना पहली बेमेल जगह पर रुक जाती है, और लगने वाला समय हमलावर को बता देता है कि उसने कितने शुरुआती अक्षर सही अंदाज़े में लगाए (timing attack)। इसके लिए कॉन्स्टेंट-टाइम तुलना फ़ंक्शन चाहिए, जैसे PHP का hash_equals।
क्या एक ही कुंजी कई अलग-अलग मक़सद के लिए इस्तेमाल की जा सकती है?
इसकी सलाह नहीं दी जाती। अगर वही सीक्रेट की वेबहुक साइनिंग और किसी दूसरे मक़सद दोनों के लिए इस्तेमाल हो, तो एक सिस्टम के कॉम्प्रोमाइज़ होने से दूसरा भी अपने-आप कॉम्प्रोमाइज़ हो जाता है — हर अलग मक़सद के लिए अलग कुंजी जनरेट करनी चाहिए।