选择基元
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
选择您的使用场景以确定正确的原语,然后点击相应链接,获取有关使用该原语的指南。
加密数据…
|
原初 |
详细信息 |
...采用标准尺寸 |
关联数据加密的身份验证 (AEAD) |
- 适合大多数需求 - 接受最大 232 字节的明文 - 提供明文机密性,并验证完整性和真实性 |
...在大型文件或数据流中 |
流式 AEAD |
- 对于过大而无法在单个步骤中处理的数据 |
...确定性地 |
确定性 AEAD |
- 对于给定的纯文本和密钥,生成相同的密文 |
...使用受 KMS 保护的密钥 |
Key Management System (KMS) Envelope AEAD |
- 使用新的 AEAD 密钥 加密每个明文- 使用 KMS 加密每个 AEAD 密钥 |
...使用公钥加密,使用私钥解密 |
混合加密
|
- 未经过身份验证 - 当发送者无法存储密钥(私钥)时很有用 |
所有这些原语都能够将密文绑定到其上下文。
通过以下方式确保数据的真实性和完整性:
其他
有问题吗?
在 Tink 组织页面上链接的特定语言 GitHub 代码库中创建问题。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eTink provides cryptographic primitives for encrypting data, ensuring authenticity and integrity, and managing keys, categorized by use case for easy selection.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can choose from primitives like AEAD, Streaming AEAD, Deterministic AEAD, KMS Envelope AEAD, and Hybrid Encryption for data encryption with varying features and functionalities.\u003c/p\u003e\n"],["\u003cp\u003eMAC and Digital Signature primitives are available for verifying data integrity and authenticity, with different verification mechanisms.\u003c/p\u003e\n"],["\u003cp\u003eTink supports JSON Web Tokens (JWTs) and offers KMS-Encrypted Primitives for advanced key management scenarios.\u003c/p\u003e\n"],["\u003cp\u003eDetailed guidance on primitive usage is accessible via linked documentation for each specific implementation.\u003c/p\u003e\n"]]],["The content outlines cryptographic primitives based on use cases. For encrypting data, options include AEAD for standard needs, Streaming AEAD for large data, Deterministic AEAD for consistent ciphertexts, KMS Envelope AEAD for key protection, and Hybrid Encryption for public/private key scenarios. For data integrity and authenticity, MACs and Digital Signatures are available. Additional primitives include JWTs, and KMS-encrypted primitives for securing keysets. All encryption methods allow binding ciphertext to context. Questions can be raised in the GitHub repository.\n"],null,["# Choose a primitive\n\nSelect your use case to identify the correct primitive, then follow the link for\nguidance on using the primitive.\n\nEncrypt data...\n---------------\n\n| | Primitive | Details |\n|--------------------------------------------------------------------------------|----------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [...in standard sizes](/tink/encrypt-data) | **Authenticated Encryption with Associated Data (AEAD)** | - Suitable for most needs - Accepts plaintexts up to 2^32^ bytes - Provides plaintext confidentiality and verifies integrity and authenticity |\n| [...in large files or data streams](/tink/encrypt-large-files-or-data-streams) | **Streaming AEAD** | - For data that is too large to be processed in a single step |\n| [...deterministically](/tink/deterministic-encryption) | **Deterministic AEAD** | - Produces same ciphertext for a given plaintext and key |\n| [...with keys protected by a KMS](/tink/client-side-encryption) | **Key Management System (KMS) Envelope AEAD** | - Encrypts every plaintext with new AEAD key - Encrypts every AEAD key with KMS |\n| [...with public key, decrypt data with private key](/tink/exchange-data) | **Hybrid Encryption** | - Not authenticated - Useful when senders cannot store secrets (private key) |\n\nThese primitives are all able to [bind ciphertext to its\ncontext](/tink/bind-ciphertext).\n\nEnsure authenticity and integrity of data by...\n-----------------------------------------------\n\n| | Primitive | Details |\n|------------------------------------------------------------------------------------------------|---------------------------------------|-------------------------------------------------------------------|\n| [...creating and verifying MAC with one key](/tink/protect-data-from-tampering) | **Message Authentication Code (MAC)** | - Very fast - Only verifiable by parties who can also create MACs |\n| [...creating signature with private key, verifying with public key](/tink/digitally-sign-data) | **Digital Signature** | - Verifiable by parties who cannot create signatures |\n\nMiscellany\n----------\n\n| | Primitive | Details |\n|-------------------------------------------------------------------------------------------|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Create and verify JWTs](/tink/create-jwts) | **JSON Web Tokens (JWTs)** | - Can additionally convert to / from JSON Web Key (JWK) format |\n| [Encrypt any primitive's keyset with a KMS](/tink/key-management-overview#encrypt_keyset) | **KMS-Encrypted Primitive** | - Doesn't require interacting with the KMS every time the primitive is used (e.g. to encrypt a plaintext), unlike [KMS Envelope AEAD](#encrypt_data) |\n\nHave a question?\n----------------\n\nCreate an issue in the language-specific GitHub repository linked on the [Tink\norganization page](https://github.com/tink-crypto)."]]