-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add HMAC API and use KMS secret key crypto
This commit does two closely related things: - It replaces the existing AES/ChaCha20 secret key implementation with a newer one based on the MinIO KMS implementation. - Adds an HMAC API such that clients can compute a HMAC checksum over a message. The new secret key implementation is located in the `internal/crypto` package. It is fully backwards compatible with the previous implementation that resided in `internal/key` and is removed by this PR. In particular, all ciphertexts produced with existing keys can be decrypted with the added implementation. The new implementation cleans up some design issues in the previous AES-256 and ChaCha20 ciphertext generation: - Now, ciphertexts have no structure or format. They only consist of the AEAD ciphertext (encrypted plaintext + auth. tag) and the 224 bit (28 byte) nonce. - Forward and backward compatibility information is no longer embedded into the ciphertext but instead into the key. For example, if we ever want to update the AES scheme, e.g. from AES-GCM or AES-SIV, (which we never did btw) we just create a new secret key type. This has also the side effect of ciphertexts getting significantly smaller (half the size). Since each MinIO object embeds at least one ciphertext in its metadata, this can give be a small perf. improvement when listing a lot of encrypted objects. *** The new HMAC API allows clients to compute a deterministic keyed checkusm (MAC) over some data without having direct access to the HMAC key. Clients may use this to verify that messages are authentic or generate the same pseudo-random secret on startup. Signed-off-by: Andreas Auernhammer <[email protected]>
- Loading branch information
Showing
17 changed files
with
1,438 additions
and
684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.