Mã hoá xác thực xác thực với dữ liệu liên kết (AEAD xác định)
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Mã hoá xác thực có tính xác định với dữ liệu liên kết (AEAD có tính xác định) cung cấp tính năng mã hoá với thuộc tính có tính xác định: việc mã hoá cùng một dữ liệu luôn tạo ra cùng một văn bản đã mã hoá. Loại mã hoá này rất hữu ích cho việc gói khoá hoặc cho một số lược đồ tìm kiếm trên dữ liệu đã mã hoá (xem RFC 5297, Mục 1.3 để biết thêm thông tin). Do thuộc tính xác định của hàm số nguyên tố này, việc triển khai hàm số nguyên tố này có thể dẫn đến việc mất tính bảo mật vì kẻ tấn công chỉ cần tìm ra văn bản đã mã hoá cho một thông báo nhất định để xác định các thực thể khác của thông báo đó.
AEAD xác định có các thuộc tính sau:
Secrecy: Không có thông tin nào về văn bản thô, ngoại trừ độ dài và tính đồng nhất của các văn bản thô lặp lại.
Tính xác thực: Không thể thay đổi văn bản thô đã mã hoá cơ bản của văn bản đã mã hoá mà không bị phát hiện.
Đối xứng: Việc mã hoá văn bản thô và giải mã văn bản đã mã hoá được thực hiện bằng cùng một khoá.
Định tính: Miễn là khoá chính không thay đổi, việc mã hoá văn bản thô hai lần bằng cùng một tham số sẽ dẫn đến cùng một văn bản đã mã hoá.
Dữ liệu liên quan
Bạn cũng có thể dùng AEAD có tính chất xác định để liên kết văn bản đã mã hoá với dữ liệu liên kết cụ thể. Ví dụ: nếu bạn có một cơ sở dữ liệu với các trường user-id và encrypted-medical-history: Trong trường hợp này, user-id có thể được dùng làm dữ liệu liên kết khi mã hoá encrypted-medical-history. Điều này ngăn kẻ tấn công chuyển hồ sơ y tế từ người dùng này sang người dùng khác.
Chọn loại khoá
Bạn nên sử dụng loại khoá AES256_SIV cho tất cả các trường hợp sử dụng.
Cam kết bảo mật
Độ mạnh của chế độ xác thực tối thiểu là 80 bit.
Văn bản thô và dữ liệu liên kết có thể có độ dài tuỳ ý (trong phạm vi từ 0 đến 232 byte).
Cấp độ bảo mật 128 bit chống lại các cuộc tấn công khôi phục khoá, cũng như trong các cuộc tấn công nhiều người dùng với tối đa 232 khoá – tức là nếu đối phương thu được 232 văn bản đã mã hoá của cùng một thông báo được mã hoá theo 232 khoá, thì họ cần thực hiện 2128 phép tính để lấy một khoá duy nhất.
Khả năng mã hoá an toàn 238 thư, miễn là mỗi thư có kích thước dưới 1 MB.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eDeterministic Authenticated Encryption with Associated Data (AEAD) encrypts the same data into the same ciphertext, useful for key wrapping or searchable encryption but revealing repeated messages.\u003c/p\u003e\n"],["\u003cp\u003eIt offers secrecy (except for length and repetition), authenticity, symmetry, and determinism in encryption.\u003c/p\u003e\n"],["\u003cp\u003eWhile associated data is authenticated, it is not encrypted, allowing ciphertext binding to specific contexts like user IDs.\u003c/p\u003e\n"],["\u003cp\u003eThe recommended key type is AES256_SIV, providing strong security guarantees including 128-bit security level and the capacity to encrypt numerous messages safely.\u003c/p\u003e\n"],["\u003cp\u003eDeterministic AEAD is suitable for scenarios where deterministic encryption and context binding are prioritized, such as preventing unauthorized data transfer in databases.\u003c/p\u003e\n"]]],["Deterministic AEAD encrypts data deterministically, producing the same ciphertext for identical data. It offers secrecy (except for repeated plaintexts), authenticity, symmetry, and determinism. A key use is binding ciphertext to associated data for integrity. While offering strong security, repeated messages can reveal equality. Associated data is authenticated but not encrypted. The AES256_SIV key type is recommended, ensuring at least 80-bit authentication and 128-bit security against key recovery. It supports large messages and numerous encryptions.\n"],null,["# Deterministic Authenticated Encryption with Associated Data (Deterministic AEAD)\n\nThe Deterministic Authenticated Encryption with Associated Data (Deterministic\nAEAD) primitive provides encryption with a *deterministic* property: encrypting\nthe same data always yields the same ciphertext. This type of encryption is\nuseful for key wrapping or for some schemes for searching on encrypted data (see\n[RFC 5297, Section\n1.3](https://tools.ietf.org/html/rfc5297#section-1.3)\nfor more info). Because of its deterministic property, implementations of this\nprimitive can lead to loss of secrecy because an attacker only needs to find out\nthe ciphertext for a given message to identify other instances of that message.\n\nDeterministic AEAD has the following properties:\n\n- **Secrecy**: Nothing about the plaintext is known, except its length and the equality of repeated plaintexts.\n- **Authenticity**: It is impossible to change the encrypted plaintext underlying the ciphertext without being detected.\n- **Symmetric**: Encrypting the plaintext and decrypting the ciphertext is done with the same key.\n- **Deterministic**: As long as the primary key is not changed, encrypting a plaintext twice with the same parameters results in the same ciphertext.\n\n| **Note:** Deterministic AEAD protects data almost as well as the normal AEAD primitive. However, if you send the same message twice, an attacker can notice that the two messages are equal. If this is not the intended behaviour, see [AEAD](/tink/aead).\n\n### Associated data\n\n| **Caution:** Associated data is authenticated but *NOT* encrypted.\n\nDeterministic AEAD can also be used to [tie ciphertext to specific associated\ndata](/tink/bind-ciphertext). For example, if you have a database with the fields\n`user-id` and `encrypted-medical-history`: In this scenario, `user-id` can be\nused as associated data when encrypting `encrypted-medical-history`. This\nprevents an attacker from moving medical history from one user to another.\n\n### Choose a key type\n\nWe recommend the **AES256_SIV** key type for all use cases.\n| **Note:** Tink doesn't offer AES128_SIV because it doesn't provide 128-bit security in multi-user scenarios.\n\n### Security guarantees\n\n- At least 80-bit authentication strength.\n- The plaintext and associated data can have arbitrary lengths (within the range 0..2^32^ bytes).\n- 128-bit security level against key recovery attacks, and also in multi-user attacks with up to 2^32^ keys --- that means if an adversary obtains 2^32^ ciphertexts of the same message encrypted under 2^32^ keys, they need to do 2^128^ computations to obtain a single key.\n- The ability to safely encrypt 2^38^ messages, provided each is less than 1MB in length.\n\n| **Caution:** **Deterministic AEAD offers no secrecy guarantees for associated\n| data.**\n\n### Example use case\n\nSee I want to [encrypt data deterministically](/tink/deterministic-encryption) and\nI want to [bind ciphertext to its context](/tink/bind-ciphertext)."]]