explaingit

tink-crypto/tink

13,539JavaAudience · developerComplexity · 3/5Setup · moderate

TLDR

A cryptography library from Google that makes encryption, signing, and key management easy to do safely across Java, Android, Go, Python, and C++, with an API designed to prevent common security mistakes. Note: this repo is now archived, use github.com/tink-crypto for active development.

Mindmap

mindmap
  root((Tink crypto))
    What It Does
      Safe encryption API
      Key management
      Sign and verify data
    Supported Languages
      Java and Android
      Go
      Python
      C++ and ObjC
    Operations
      Symmetric encryption
      Digital signatures
      Streaming encryption
    Status
      Archived repo
      New org tink-crypto
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Encrypt sensitive data in your app using a safe, opinionated API that steers you away from cryptographic mistakes that create vulnerabilities.

USE CASE 2

Sign and verify data to confirm it has not been tampered with, without writing low-level cryptography code yourself.

USE CASE 3

Manage, store, and rotate encryption keys using the Tinkey command-line tool.

USE CASE 4

Stream-encrypt large files without loading the entire file into memory.

Tech stack

JavaAndroidC++GoPythonObjective-C

Getting it running

Difficulty · moderate Time to first run · 30min

This repository is archived, all active development has moved to separate repositories at github.com/tink-crypto.

In plain English

Tink is a cryptography library created by engineers and cryptographers at Google, designed to make encryption and related security operations easier for developers to use correctly. Cryptography code is notoriously easy to implement incorrectly in ways that create security vulnerabilities, even for experienced programmers. Tink addresses this by providing a simplified, opinionated API that guides you toward safe choices and makes dangerous options harder to reach by accident. It was built from Google's internal experience identifying and fixing cryptographic mistakes across hundreds of products. The library supports Java, Android, C++, Go, Python, and Objective-C, with all of those except a JavaScript version described as production-ready. It covers common cryptographic tasks such as encrypting data, signing and verifying data, generating and managing encryption keys, and streaming encryption for large amounts of data. The library also includes a command-line tool called Tinkey for managing encryption keys. An important note about this repository: it is no longer active. The Tink team split the project into multiple separate repositories hosted at github.com/tink-crypto, and this original repository is now read-only and will not receive future updates. If you want to use Tink, you should go to the new repositories at that organization rather than using this one. The last version released here was 1.7.0 in August 2022. Community members have also created ports to languages not officially supported, such as Clojure, though those ports are not maintained by the Google team and carry no official support guarantee.

Copy-paste prompts

Prompt 1
Using Google Tink in Java, show me how to generate an AES-GCM encryption key, encrypt a string, and decrypt it, include how to serialize and save the keyset.
Prompt 2
How do I use Tink in Python to sign a message with a private key and verify the signature with the public key? Show working code end to end.
Prompt 3
I need to rotate encryption keys using Tink's Tinkey CLI. Show me how to generate a new keyset, add a new key, and promote it as the primary while keeping old keys for decryption.
Prompt 4
Show me how to stream-encrypt a large file in Go using Google Tink so the whole file never has to be in memory at once.
Open on GitHub → Explain another repo

← tink-crypto on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.