Coder Social home page Coder Social logo

quinndiggity / tink Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tink-crypto/tink

0.0 2.0 0.0 7.05 MB

Tink is a multi-language, cross-platform library that provides a simple and misuse-proof API for common cryptographic tasks.

License: Apache License 2.0

Python 5.67% Java 53.98% C++ 24.66% C 0.38% Go 8.65% Shell 0.79% Objective-C 1.96% Objective-C++ 3.93%

tink's Introduction

Tink

Ubuntu macOS
Kokoro Ubuntu Kokoro macOS

Introduction

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.

Getting started

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 ciphertext
  • decrypt(ciphertext, associated_data), which decrypts the given ciphertext (using associated_data as additional AEAD-input) and returns the resulting plaintext

Before 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 for Java 1.1.0:

    import com.google.crypto.tink.Config;
    import com.google.crypto.tink.config.TinkConfig;

    Config.register(TinkConfig.TINK_1_1_0);

After implementations of primitives have been registered, the basic use of Tink proceeds in three steps:

  1. Load or generate the cryptographic key material (a Keyset in Tink terms).
  2. Use the key material to get an instance of the chosen primitive.
  3. Use that primitive to accomplish the cryptographic task.

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);

Current Status

Learn More

Contact and mailing list

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 [email protected].

Maintainers

Tink is maintained by:

  • Daniel Bleichenbacher
  • Thai Duong
  • Quan Nguyen
  • Bartosz Przydatek

tink's People

Contributors

thaidn avatar przydatek avatar cryptosubtlety avatar tl0gic avatar eyesonly09 avatar bleichen avatar ise-crypto avatar waltercacau avatar rjamet avatar chuckx avatar kbsriram avatar gdbelvin avatar meheramaresh avatar ericbock avatar dlsniper avatar docmerlin avatar widdershin avatar saqibm128 avatar therealhaui avatar kreuzerk avatar pkorth avatar

Watchers

Quinn Diggity avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.