Amazon Encryption SDK

From NovaOrdis Knowledge Base
Revision as of 23:02, 12 December 2018 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

External

Internal

Overview

Amazon Encryption SDK provides an encryption library that optionally integrates with AWS KMS and uses it as a master key provider. The SDK generates, encrypts and decrypts data keys, uses those data keys to encrypt and decrypt raw data, and stores encrypted data keys with the corresponding encrypted data in a single object. The AWS Encryption SDK and the Amazon S3 encryption client are not compatible because they produce ciphertexts with different data formats. The library uses an AES-GCM encryption algorithm with 256-bit, 192-bit and 128-bit encryption keys. The length of the Initialization Vector is 12 bytes. The length of the authentication tag is 16 bytes. By default, the SDK uses the data key as an input to the HMAC-based extract-and-expand key derivation function (HKDF) to derive the AES-GCM encryption key, and also adds an Elliptic Curve Digital Signature Algorithm (ECDSA) signature.


Dependencies

dependencies {
    implementation('org.bouncycastle:bcprov-ext-jdk15on:1.58')
    implementation('com.amazonaws:aws-encryption-sdk-java:1.3.1')
}

Clarify whether I need KMS API or not: AWS KMS API Dependencies.

Concepts

Amazon Encryption SDK Concepts

Encryption

Overhead Introduced by Amazon Encryption SDK Message Format

Encrypting data with Amazon Encryption SDK introduces a certain amount of space overhead, mainly due to the fact that the data key, after being encrypted with the customer master key, is stored together with the cipher text. The amount of overhead depends on the size of the clear text data, encryption algorithm, whether additional authenticated data (AAD) is provided, and the length of that AAD, the number and type of master key providers, and the frame size. When AWS Encryption SDK is used with its default configuration, with one CMK in AWS KMS as the master key, with no AAD, and encrypt non-framed data, the overhead is approximately 600 bytes. In general, it can be reasonably assumed that Amazon Encryption SDK adds overhead of 1KB or less, not including AAD.

Playground Example

Playground AWS Encryption SDK Examples