Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tink, a library created to make crypto easy for non cryptographers, is a strong candidate that offers pluggability of crypto operations and supports integration with multiple KMS solutions like AWS KMS, GCP (Google Cloud KMS) and Android Keystore KMS. It supports multi languages including Go. Tink serves to wrap the crypto functions in a KMS, so the client cannot see secrets, and so the client works with a simpler API that makes it harder to break your crypto. It also supports key wrapping using ECDH, but it does not match ECDH-1PU which will require additional work.


The plan is to have 2 3 interfaces in two three sub-directories under pkg/plugins, one for Packer, another for Crypto and the other for KMS. These Crypto and KMS interfaces will serve as wrapper to Tink operations like Encrypt(), Decrypt(), Sign(), Verify(), etc. While Packer will use the other two to build a JWE envelope.




The introduction of Tink begins with Crypto interface for which an implementation will use Tink primitives for the crypto operations. Tink will need to be updated to use a custom AEAD cipher with key wrapping using ECDH-1PU. The implementation will somewhat resemble the Hybrid AEAD one in Tink with the difference in the key derivation function differs in 1PU (here) than the conventional and standardized ES (example here) mode.


In Tink, operations are isolated in a distinguished interface grouped by the type of crypto used. There are interfaces for deterministic aead (payload re encryptions yield the same output, this implementation is not recommend), aead (direct mode, no key wrapping), hybrid aead (with key wrapping including key derivation defined as ECDH-ES), signatures and MAC hashing. Our interfaces will be similar to the following: