मैसेज की पुष्टि करने वाला कोड (MAC)
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
MAC प्रिमटिव की मदद से, यह पुष्टि की जा सकती है कि किसी ने आपके डेटा में छेड़छाड़ तो नहीं की है.
मैसेज भेजने वाला व्यक्ति, मैसेज पाने वाले व्यक्ति के साथ सिमेट्रिक पासकोड शेयर कर सकता है. इससे, वह किसी मैसेज के लिए पुष्टि करने वाला टैग कैलकुलेट कर सकता है. इससे मैसेज पाने वाले व्यक्ति को यह पुष्टि करने में मदद मिलती है कि मैसेज, मैसेज भेजने वाले व्यक्ति से मिला है और उसमें कोई बदलाव नहीं किया गया है.
MAC में ये प्रॉपर्टी होती हैं:
- पुष्टि: पुष्टि करने लायक एमएसी टैग बनाने का एकमात्र तरीका, पासकोड को जानना है.
- Symmetric: टैग को कंप्यूट करने और उसकी पुष्टि करने के लिए, एक ही पासकोड की ज़रूरत होती है.
एल्गोरिदम के आधार पर, एमएसी पता तय या रैंडम हो सकता है. फ़िलहाल, Tink में नॉन-डेटरमिनिस्टिक MAC एल्गोरिदम लागू नहीं किए जाते. आपको मैसेज की पुष्टि करने के लिए ही एमएसी का इस्तेमाल करना चाहिए. इसे किसी दूसरे मकसद के लिए इस्तेमाल नहीं किया जाना चाहिए. जैसे, झूठी रैंडम बाइट जनरेट करना. इसके लिए, पीआरएफ़ देखें.
अगर आपको इसके बजाय असिमेट्रिक प्राइमिटिव की ज़रूरत है, तो डिजिटल हस्ताक्षर देखें.
कुंजी का टाइप चुनना
हमारा सुझाव है कि ज़्यादातर कामों के लिए HMAC_SHA256 का इस्तेमाल करें. हालांकि, इसके अलावा भी अन्य विकल्प उपलब्ध हैं.
आम तौर पर, ये बातें सही हैं:
सुरक्षा से जुड़ी कम से कम गारंटी
- पुष्टि करने का तरीका कम से कम 80-बिट का हो
- चुनी गई साफ़ टेक्स्ट वाली कुंजी के हमले के तहत, मौजूदा फ़ोर्जरी से सुरक्षित रखना
- कुंजी वापस पाने के हमलों के ख़िलाफ़ कम से कम 128-बिट की सुरक्षा, साथ ही कई उपयोगकर्ताओं के मामले में भी (जब हमलावर किसी खास कुंजी को टारगेट नहीं कर रहा है, लेकिन 32 कुंजियों के सेट में से किसी भी कुंजी को टारगेट कर रहा है)
इस्तेमाल के उदाहरण
मुझे डेटा में छेड़छाड़ होने से बचाना है लेख पढ़ें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThe Message Authentication Code (MAC) primitive, using a shared symmetric key, enables verification of data integrity and authenticity by generating an authentication tag.\u003c/p\u003e\n"],["\u003cp\u003eMAC ensures authenticity as only the key holder can create a verifiable tag, and it's symmetric, requiring the same key for both computation and verification.\u003c/p\u003e\n"],["\u003cp\u003eTink recommends HMAC_SHA256 for most use cases, while HMAC_SHA512 offers higher security and AES256_CMAC might provide better performance with specific hardware.\u003c/p\u003e\n"],["\u003cp\u003eTink's MAC implementation guarantees a minimum of 80-bit authentication strength, protection against forgery, and at least 128-bit security against key recovery attacks, even in multi-user environments.\u003c/p\u003e\n"]]],["MAC uses a shared symmetric key between sender and recipient to verify message authenticity and integrity. The sender computes an authentication tag for a message, which the recipient uses to confirm its origin and unaltered state. MAC guarantees authenticity, where only key holders can create verifiable tags. Key recommendations include HMAC_SHA256, HMAC_SHA512 (most conservative), and AES256_CMAC (fastest with AES-NI). MAC is designed solely for message authentication, offering a minimum of 80-bit authentication strength.\n"],null,[]]