বার্তা প্রমাণীকরণ কোড (MAC)
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ম্যাক আদিম আপনাকে যাচাই করতে দেয় যে কেউ আপনার ডেটার সাথে কারসাজি করেনি। একজন প্রেরক প্রাপকের সাথে একটি সিমেট্রিক কী ভাগ করে একটি প্রদত্ত বার্তার জন্য একটি প্রমাণীকরণ ট্যাগ গণনা করতে পারে, যা প্রাপককে যাচাই করতে দেয় যে একটি বার্তা প্রত্যাশিত প্রেরকের কাছ থেকে এসেছে এবং সংশোধন করা হয়নি।
MAC এর নিম্নলিখিত বৈশিষ্ট্য রয়েছে:
- সত্যতা : একটি যাচাইযোগ্য MAC ট্যাগ তৈরি করার একমাত্র উপায় কীটি জানা।
- সিমেট্রিক : ট্যাগ কম্পিউটিং এবং যাচাই করার জন্য একই কী প্রয়োজন।
অ্যালগরিদমের উপর নির্ভর করে MAC নির্ধারক বা এলোমেলো হতে পারে। Tink এই মুহুর্তে নন-ডিটারমিনিস্টিক MAC অ্যালগরিদম বাস্তবায়ন করে না। আপনার শুধুমাত্র বার্তা প্রমাণীকরণের জন্য MAC ব্যবহার করা উচিত, সিউডোর্যান্ডম বাইট তৈরির মতো অন্যান্য উদ্দেশ্যে নয় (এর জন্য, PRF দেখুন)।
যদি আপনার পরিবর্তে একটি অসমমিতিক আদিম প্রয়োজন হয়, ডিজিটাল স্বাক্ষর দেখুন।
একটি কী টাইপ বেছে নিন
আমরা বেশিরভাগ ব্যবহারের জন্য HMAC_SHA256 ব্যবহার করার পরামর্শ দিই, তবে অন্যান্য বিকল্পও রয়েছে।
সাধারণভাবে, নিম্নলিখিতগুলি সত্য হয়:
ন্যূনতম নিরাপত্তা গ্যারান্টি
- কমপক্ষে 80-বিট প্রমাণীকরণ শক্তি
- নির্বাচিত প্লেইনটেক্সট আক্রমণের অধীনে অস্তিত্বমূলক জালিয়াতির বিরুদ্ধে সুরক্ষিত
- মূল পুনরুদ্ধার আক্রমণের বিরুদ্ধে কমপক্ষে 128-বিট নিরাপত্তা, এবং বহু-ব্যবহারকারীর পরিস্থিতিতেও (যখন একজন আক্রমণকারী একটি নির্দিষ্ট কীকে লক্ষ্য করে না, তবে 2 32 কী পর্যন্ত সেট থেকে যেকোনো কী)
উদাহরণ ব্যবহার ক্ষেত্রে
দেখুন আমি টেম্পারিং থেকে ডেটা রক্ষা করতে চাই ।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-25 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["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,["# Message Authentication Code (MAC)\n\nThe MAC primitive lets you to verify that no one has tampered with your data.\nA sender sharing a *symmetric key* with a recipient can compute an\n*authentication tag* for a given message, which allows the recipient to verify\nthat a message is from the expected sender and has not been modified.\n\nMAC has the following properties:\n\n- **Authenticity**: Knowing the key is the only way to create a verifiable MAC tag.\n- **Symmetric**: Computing and verifying the tag requires the same key.\n\nMAC can be deterministic or randomized, depending on the algorithm. Tink does\nnot implement non-deterministic MAC algorithms at the moment. You should use MAC\nonly for message authentication, not for other purposes like generation of\npseudorandom bytes (for that, see [PRF](/tink/prf)).\n\nIf you need an asymmetric primitive instead, see [Digital\nSignature](/tink/digital-signature).\n\n### Choose a key type\n\nWe recommend using **HMAC_SHA256** for most uses, but there are other options as\nwell.\n\nIn general, the following holds true:\n\n- HMAC_SHA512 may or may not be faster depending on your message size and the specifics of the hardware you use.\n- HMAC_SHA512 is the most conservative mode that can be used for practically unlimited number of messages.\n- AES256_CMAC is fastest on systems that support the [AES-NI](https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-encryption-standard-instructions-aes-ni.html) hardware\n acceleration.\n\n | **Note:** Tink doesn't offer AES128_CMAC because it doesn't offer 128-bit security in multi-user scenarios.\n\n### Minimal security guarantees\n\n- At least 80-bit authentication strength\n- Secure against existential forgery under chosen plaintext attack\n- At least 128-bit security against key recovery attacks, and also in multi-user scenarios (when an attacker is not targeting a specific key, but any key from a set of up to 2^32^ keys)\n\n### Example use case\n\nSee [I want to protect data from tampering](/tink/protect-data-from-tampering)."]]