ฉันต้องการเชื่อมโยงข้อความการเข้ารหัสกับบริบท
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
โหมดการเข้ารหัสสมัยใหม่รองรับข้อมูลที่เชื่อมโยง ซึ่งได้รับการตรวจสอบสิทธิ์แต่ไม่ได้เข้ารหัส ซึ่งสามารถใช้เพื่อเชื่อมโยงข้อความที่เข้ารหัสกับบริบทที่เฉพาะเจาะจง
ตัวอย่างการเชื่อมโยงข้อความที่เข้ารหัสกับข้อมูลที่เชื่อมโยง ได้แก่
การเข้ารหัสฐานข้อมูลทีละเซลล์ (หรือทีละคอลัมน์) วิธีนี้ช่วยให้มั่นใจว่าข้อความที่เข้ารหัสของเซลล์จะใช้ได้เฉพาะในเซลล์นั้นๆ เท่านั้น ซึ่งจะช่วยป้องกันไม่ให้ผู้โจมตีย้ายข้อความที่เข้ารหัสจากเซลล์หนึ่งไปยังอีกเซลล์หนึ่ง ในตัวอย่างนี้ ข้อความที่เข้ารหัสควรเชื่อมโยงกับ column_id
และ row_id
สำหรับเซลล์ฐานข้อมูลที่ระบุ
การจัดเก็บข้อความที่เข้ารหัสในไคลเอ็นต์ต่างๆ ช่วยให้คุณตรวจจับพฤติกรรมที่ไม่ถูกต้องได้หากไคลเอ็นต์ ก ให้ข้อความที่เข้ารหัสของไคลเอ็นต์ ข เพื่อถอดรหัส ในกรณีนี้ ข้อความที่เข้ารหัสควรเชื่อมโยงกับชื่อของลูกค้า
Tink มีตัวเลือกหลายอย่างในการเชื่อมโยงข้อความที่เข้ารหัสกับบริบท ดังนี้
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eModern encryption techniques can authenticate additional data without encrypting it, ensuring data integrity and context.\u003c/p\u003e\n"],["\u003cp\u003eThis "associated data" links ciphertext to its specific location or user, preventing unauthorized use or manipulation.\u003c/p\u003e\n"],["\u003cp\u003eTink offers multiple encryption options, including AEAD, Streaming AEAD, Deterministic AEAD, and Hybrid Encryption, that support binding ciphertext to its context for enhanced security.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize associated data to prevent attacks like ciphertext movement or unauthorized decryption by ensuring the ciphertext remains tied to its intended context.\u003c/p\u003e\n"]]],["Encryption modes utilize associated data to authenticate but not encrypt, binding ciphertexts to specific contexts. This prevents ciphertext misuse. Examples include binding database cell data to `column_id` and `row_id` or binding data to a client's name. Tink offers this functionality through AEAD, Streaming AEAD, Deterministic AEAD with an associated data input and Hybrid encryption with a context info parameter. Decryption fails if the correct associated data is not provided.\n"],null,["# I want to bind ciphertext to its context\n\nModern encryption modes support *associated data*, which is authenticated but\nnot encrypted. This can be used to bind a ciphertext to a specific context.\n\nExamples of binding ciphertext to associated data include:\n\n- Encrypting a database cell-by-cell (or column-by-column). This ensures the\n cell's ciphertext is only valid in that specific cell. This prevents the\n attacker from moving the ciphertext from one cell to another. In this\n example, the ciphertext should be bound to the `column_id` and `row_id` for\n the given database cell.\n\n- Storing ciphertexts in different clients lets you detect misbehavior if\n Client A provides Client B's ciphertext for decryption. Here, the ciphertext\n should be bound to the client's name.\n\nTink has several options for binding ciphertext to its context:\n\n- [AEAD](/tink/aead), [Streaming AEAD](/tink/streaming-aead), and [Deterministic\n AEAD](/tink/deterministic-aead) all accept an associated data input along with\n the plaintext. The decryption fails if the associated data is not provided\n with the ciphertext.\n\n- [Hybrid encryption](/tink/hybrid) provides the same feature using the [context\n info parameter](/tink/hybrid#context_info_parameter)."]]