Tink とは
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Tink は、オープンソースの暗号ライブラリで、
セキュリティエンジニアですTink の安全でシンプルな API により、
ユーザー中心の設計、慎重な実装とコードレビューを通じて、
大規模なテストを行っています。(このページの目標に関するセクションを参照)
Tink が達成を目指していた目標をより詳細に把握できるようになりました。
Tink を使用すると、暗号の知識がないユーザーでも、一般的なセキュリティ インフラストラクチャを安全に実装できます。
タスクを自動化できます。Tink は Google で何百ものプロダクトに導入され、
説明します。
Tink を使用すべき理由は何ですか?
Tink を使用する主な理由は、次のとおりです。
使い方は簡単
暗号化は容易なことではありません。Tink を使用すると、
暗号化または署名する
組み込みのセキュリティ保証をわずか数行のコードで実現できます。Tink は、
外部の鍵管理システムを使用して鍵のローテーションや鍵の保護を行う
(KMS)。
安全である
Tink は BoringSSL などのよく知られたライブラリに加えてセキュリティ保護を追加します
インターフェースに表示しますが
監査者やツールがギャップをすばやく見つけられるようになります。Tink は、実行している API を
危険性があるため、モニタリングできます。
互換性のある
Tink 暗号テキストは既存の暗号ライブラリと互換性があります。ティンク
Google Cloud での鍵の暗号化や保存も
Amazon KMS、Google Cloud KMS、Android Keystore、iOS キーチェーンです。
Tink の利用者
Tink は、Google、Square、Citadel などの多くの企業で広く使用されており、
数百社の Google Cloud のお客様と Google Pay パートナーに
提供できますTink も
多くの一般的な Android アプリを保護する Jetpack Security ライブラリを強化
たとえば Slack、adidas、AirBnb、Nextdoor などです
Tink ゴール
他の暗号ライブラリと比較した Tink の主な目的は何ですか。
これらの目標を達成するために Tink が使用する主なメカニズムは何ですか?
要するに、Tink には 2 つの目標があります。
- 暗号のアジリティの向上: ユーザーが鍵を変更し、
構築できます。
- セキュリティ レビューを有効にする: Tink の目的は、ユーザーが次のようなコードを書くことを可能にすることです。
セキュリティをローカルでレビューできます。そのために、
保証します。
この目標を達成するために Tink が使用する主なメカニズムは次のとおりです。
- Tink は、プリミティブとインターフェースを重要な抽象化として提供します。これらの
インフラストラクチャを抽象化することで、インフラストラクチャの
アルゴリズムを使用する代わりに、想定されるセキュリティの概念を指定します。
- Tink では「キーセット」という概念が使用されています。キーセットとは、
値を返します。その結果
これは複数のキーで動作します
- Tink では、キーは基になるキー マテリアルによって指定されるだけでなく、
暗号化アルゴリズム、すべてのパラメータが含まれます。つまり
Tink キーは、常に使用可能なすべての暗号関数から
解釈の余地が残されません。
以降のセクションでは、これらのコンセプトについて詳しく説明します。
暗号化のアジリティ
Google のソフトウェア エンジニアリングについて考えてみてください。
この書籍では、ソフトウェア エンジニアリングの分野で学んだ教訓と、
「教訓」というサブタイトルです。その中で、著者は
物事が変化するという事実が持つ意味合いを説くために、大変な労力を費やしました。この
Tink のデザインの多くに影響を与えました。暗号では、データの暗号化が
変化に備える必要があります鍵が漏洩し、アルゴリズムが壊れる。
鍵とアルゴリズムを切り替えられるようにすることは、多くのユーザーにとって非常に重要であり、
慎重に検討してください
セキュリティ審査とローカル プロパティ
Tink は、AEAD インターフェースなどのインターフェースの使用を推奨しており、
データを暗号化できます。その他のセキュリティ保証の 1 つとして、AEAD は
同じ文字列を複数回暗号化しても、別々の
ありません。
使用方法を確認するために、あるエンジニアが機密のオブジェクトを保存したいと考えているとします。
ユーザー Cookie 内の ID。たとえば、次のようなクラスを提供するとします。
class IdEncrypter {
public static IdEncrypter createFromAead(Aead aead);
public String encrypt(long id) throws GeneralSecurityException;
public long decrypt(String encrypted) throws GeneralSecurityException;
};
Aead
を渡すと、次のプロパティを取得します。
- このコードは、
IdEncrypter
がジョブを実行するには
Aead
が提供するセキュリティ プロパティを使用する暗号化スキームです。
または
DeterministicAead
IdEncrypter
では、2 つの暗号鍵で暗号化されたデータが必要です。
異なります。一方、パラメータとして渡す関数のインスタンスを
AES GCM 暗号化ツール(Aead
の特定のインスタンス 1 つ)が過剰になります。
厳格: IdEncrypter
には任意の Aead があれば十分ですが、
1 つの特定のアルゴリズムである必要があります
- セキュリティ審査ではこの点が考慮されます。セキュリティ審査担当者は
コード リポジトリ全体を調べて
どこかで、誰かが
Aead
のサブクラスを作成しましたが、これは使用が安全ではありません
IdEncrypter
に置き換えます。その代わり、Tink はセキュリティの特性を提供しています。
Aead オブジェクトにはすでに存在しており、審査担当者はこれらで十分かどうかを確認できます。
特に、2 つ目の項目については細心の注意を払う必要があります。ユーザーは頻繁に
「正しくない」アルゴリズムをAead
。前のポイントは、
これは危険です。次の動作をする Aead
の実装を利用できる場合
必要なセキュリティ保証を提供しないと、IdEncrypter
が安全でない可能性があります。
セキュリティレビューを行うエンジニアは
追加のコードを調べる必要があります
オブジェクトが正しくインスタンス化されていることを確認する必要があります。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eTink is an open-source cryptography library designed for easy and secure implementation of common cryptographic tasks, even for users without a cryptography background.\u003c/p\u003e\n"],["\u003cp\u003eTink prioritizes security by adding protections on top of existing libraries like BoringSSL, using distinct APIs for potentially risky operations, and ensuring ciphertext compatibility with other libraries.\u003c/p\u003e\n"],["\u003cp\u003eTink promotes cryptographic agility by enabling easy key and algorithm changes, and it supports integration with external key management systems like Amazon KMS and Google Cloud KMS.\u003c/p\u003e\n"],["\u003cp\u003eDesigned with security reviews in mind, Tink utilizes interfaces with clear security guarantees and the concept of keysets for enhanced security and code clarity.\u003c/p\u003e\n"],["\u003cp\u003eGoogle, Square, and Citadel are among the many companies that utilize Tink, further demonstrating its reliability and widespread adoption within various applications and systems.\u003c/p\u003e\n"]]],["Tink, a Google-developed open-source cryptography library, simplifies secure cryptographic implementation for users, even without cryptography expertise. It's designed for simplicity, security, and compatibility, supporting key rotation and external Key Management Systems (KMS). Tink prioritizes cryptographic agility, enabling easy key and algorithm changes, and facilitates security reviews by providing clear interfaces and security guarantees. It uses primitives, keysets, and comprehensive key specifications to achieve these goals, ensuring secure, verifiable, and adaptable cryptographic operations.\n"],null,["# What is Tink?\n\nTink is an open-source cryptography library written by cryptographers and\nsecurity engineers at Google. Tink's secure and simple APIs reduce common\npitfalls through user-centered design, careful implementation and code reviews,\nand extensive testing. See the [Goals](#tink_goals) section on this page for\nmore insight into which objectives Tink was designed to fulfil.\n\nTink helps users without a cryptography background safely implement common\ncryptographic tasks. At Google, Tink has been deployed in hundreds of products\nand systems.\n\nWhy should I use Tink?\n----------------------\n\nThe most important reasons to use Tink are:\n\n- **It's simple to use**\n\n Cryptography is difficult to get right. With Tink, you can\n [encrypt](/tink/encrypt-data) or [sign data](/tink/digitally-sign-data) with\n built-in security guarantees using just a few lines of code. Tink can also\n help you rotate keys or secure keys using external Key Management Systems\n (KMSs).\n- **It's secure**\n\n Tink adds security protections on top of well known libraries like BoringSSL\n and Java Cryptography Architecture and shows them right in the interfaces,\n so auditors and tools can quickly find gaps. Tink also separates APIs that\n are potentially dangerous, so you can monitor them.\n- **It's compatible**\n\n Tink ciphertexts are compatible with existing cryptography libraries. Tink\n also supports [encrypting or storing keys](/tink/client-side-encryption) in\n Amazon KMS, Google Cloud KMS, Android Keystore, and iOS Keychain.\n\nWho's using Tink?\n-----------------\n\nTink is widely used by many companies, including Google, Square, and Citadel, as\nwell as hundreds of Google Cloud customers and Google Pay partners. Tink also\npowers the Jetpack Security library, which secures many popular Android apps\nlike Slack, Adidas, AirBnb, and Nextdoor.\n\nTink Goals\n----------\n\nWhat are the main goals of Tink compared to other cryptographic libraries, and\nwhat are the main mechanisms which Tink uses to achieve these goals?\n\nIn short, Tink has two goals:\n\n1. *Promote cryptographic agility*: Users should be able to change keys and algorithms in a simple way.\n2. *Enable security reviews*: Tink aims to allow users to write code whose security can be reviewed locally, by providing interfaces which give clear security guarantees.\n\nThe main mechanisms Tink uses to achieve these goals are as follows:\n\n1. Tink provides primitives and interfaces as important abstractions. These abstractions allow users to write code which does not specify the exact algorithm to be used, but instead specifies the expected security notion.\n2. Tink uses the notion of a \"keyset\", which is a set of keys that are associated with a particular primitive. This results in users writing code which works with multiple keys.\n3. In Tink, keys are not only specified by the underlying key material, but also the cryptographic algorithm, as well as all parameters. This means that a Tink key always selects a unique cryptographic function from all possible functions which can exist, and leaves no room for interpretation.\n\nThe following sections explain these concepts in more detail.\n\n### Cryptographic agility\n\nConsider [Software Engineering at Google](https://abseil.io/resources/swe-book),\na book about lessons learned in the field of software engineering, with the\nsubtitle \"lessons learned from programming over time\". In it, the authors go to\ngreat lengths to implore the implications of the fact that things change. This\nfact also impacted much of the design of Tink. In cryptography, it is important\nthat one prepares for change. Keys will leak, and algorithms will be broken.\nBeing able to switch out keys and algorithms is crucial for many users, and\nbeing prepared is prudent.\n\n### Security reviews and local properties\n\nTink promotes the use of interfaces, such as our AEAD interface, which allows\nusers to encrypt data. Among [other security guarantees](https://developers.google.com/tink/aead#security_guarantees), an AEAD\nguarantees that multiple encryptions of the same string result in different\nciphertexts.\n\nTo see how this can be used, suppose an engineer wants to store some sensitive\nID in a user cookie. They might provide a class such as this: \n\n class IdEncrypter {\n public static IdEncrypter createFromAead(Aead aead);\n\n public String encrypt(long id) throws GeneralSecurityException;\n public long decrypt(String encrypted) throws GeneralSecurityException;\n };\n\nPassing an `Aead` obtains the following properties:\n\n1. The code communicates that for `IdEncrypter` to do its job, it requires an encryption scheme with the security properties an [`Aead` provides](https://developers.google.com/tink/aead#security_guarantees). Alternatively, a [`DeterministicAead`](https://developers.google.com/tink/deterministic-aead) wouldn't be enough -- the `IdEncrypter` requires that two encryptions of the same id are different. On the other hand, taking as parameter an instance of an AES GCM encrypter (one particular instance of an `Aead`) would be overly strict: any Aead is enough for `IdEncrypter` to do its job, and it does not need to be one specific algorithm.\n2. A security review can take this point into account. A security reviewer does not need to go through all of the entire code repository to check if somewhere, someone made a subclass of `Aead` which is not secure for use with `IdEncrypter`. Instead, Tink provides security properties which all Aead objects have, and the reviewer can check that these are sufficient.\n\nIn particular the second point requires a lot of care. Users often ask to add\nalgorithms which are 'not quite' an `Aead`. The previous point illustrates why\nthis is dangerous: if there is any implementation of `Aead` available which does\nnot provide the required security guarantees, `IdEncrypter` can become insecure,\nand the engineer performing a security review needs to examine additional code\nto check that the object is instantiated correctly."]]