tag | e065a57f3f31ddc1a46867b6d834d46ef875a713 | |
---|---|---|
tagger | Charles Lee <ckl@google.com> | Fri Jul 13 16:42:51 2018 -0700 |
object | e76fa741bd25114a34e690911ddd2501670458a8 |
Tink version 1.2.0-rc2
commit | e76fa741bd25114a34e690911ddd2501670458a8 | [log] [tgz] |
---|---|---|
author | Thai Duong <thaidn@google.com> | Fri Jul 13 14:55:12 2018 -0700 |
committer | Tink Team <noreply@google.com> | Fri Jul 13 14:57:08 2018 -0700 |
tree | 31d215f97260d7fc51216d50f64845ab1f902a24 | |
parent | e68edc7bddb2034aff2454ce04dd3b5e5096fe3b [diff] |
Note that C++ and Obj-C are also ready for production, also adding Haris and Charles to list of maintainers. PiperOrigin-RevId: 204533189 GitOrigin-RevId: 9ae90e72ca30baa3e6efa9783ab8f3b7d14ec690
Ubuntu | macOS |
---|---|
Using crypto in your application shouldn't have to feel like juggling chainsaws in the dark. Tink is a crypto library written by a group of cryptographers and security engineers at Google. It was born out of our extensive experience working with Google's product teams, fixing weaknesses in implementations, and providing simple APIs that can be used safely without needing a crypto background.
Tink provides secure APIs that are easy to use correctly. It reduces common crypto pitfalls with user-centered design, careful implementation and code reviews, and extensive testing. You can add features like encryption, decryption and signing to your application with Tink - the same library AdMob, Google Pay, the Android Search App and several Google products also use to secure their applications.
TIP The easiest way to get started with Tink is to install Bazel, then build, run and play with the hello world examples
.
Tink performs cryptographic tasks via so-called primitives, each of which is defined via a corresponding interface that specifies the functionality of the primitive. For example, symmetric key encryption is offered via an AEAD-primitive (Authenticated Encryption with Associated Data), that supports two operations:
encrypt(plaintext, associated_data)
, which encrypts the given plaintext
(using associated_data
as additional AEAD-input) and returns the resulting ciphertextdecrypt(ciphertext, associated_data)
, which decrypts the given ciphertext
(using associated_data
as additional AEAD-input) and returns the resulting plaintextBefore implementations of primitives can be used, they must be registered at runtime with Tink, so that Tink “knows” the desired implementations. Here's how you can register all implementations of all primitives in Tink:
import com.google.crypto.tink.config.TinkConfig; TinkConfig.register();
After implementations of primitives have been registered, the basic use of Tink proceeds in three steps:
Keyset
in Tink terms).Here is how these steps would look like when encrypting or decrypting with an AEAD primitive in Java:
import com.google.crypto.tink.Aead; import com.google.crypto.tink.KeysetHandle; import com.google.crypto.tink.aead.AeadFactory; import com.google.crypto.tink.aead.AeadKeyTemplates; // 1. Generate the key material. KeysetHandle keysetHandle = KeysetHandle.generateNew( AeadKeyTemplates.AES128_GCM); // 2. Get the primitive. Aead aead = AeadFactory.getPrimitive(keysetHandle); // 3. Use the primitive. byte[] ciphertext = aead.encrypt(plaintext, aad);
Tink for Java and Android are field tested and ready for production. The latest version is 1.2.0-rc2, released on 2018-07-13.
Tink for C++ and Tink for Obj-C are almost ready for production. The latest version is 1.2.0-rc2, released on 2018-07-13.
Tink for Go and Javascript are in active development.
If you want to contribute, please read CONTRIBUTING and send us pull requests. You can also report bugs or file feature requests.
If you'd like to talk to the developers or get notified about major new tests, you may want to subscribe to our mailing list. To join, simply send an empty email to tink-users+subscribe@googlegroups.com.
Tink is maintained by (A-Z):