AWS Encryption SDK
Developer Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

What Is the AWS Encryption SDK?

The AWS Encryption SDK is a client-side encryption library designed to make it easy for everyone to encrypt and decrypt data using industry standards and best practices. It enables you to focus on the core functionality of your application, rather than on how to best encrypt and decrypt your data.

The AWS Encryption SDK answers questions like the following for you:

  • Which encryption algorithm should I use?

  • How, or in which mode, should I use that algorithm?

  • How do I generate the encryption key?

  • How do I protect the encryption key, and where should I store it?

  • How can I make my encrypted data portable?

  • How do I ensure that the intended recipient can read my encrypted data?

  • How can I ensure my encrypted data is not modified between the time it is written and when it is read?

Without the AWS Encryption SDK, you might spend more effort on building an encryption solution than on the core functionality of your application. The AWS Encryption SDK answers these questions by providing the following things.

A Default Implementation that Adheres to Cryptography Best Practices

By default, the AWS Encryption SDK generates a unique data key for each data object that it encrypts. This follows the cryptography best practice of using unique data keys for each encryption operation.

The AWS Encryption SDK encrypts your data using a secure, authenticated, symmetric key algorithm. For more information, see Supported Algorithm Suites in the AWS Encryption SDK.

A Framework for Protecting Data Keys with Master Keys

The AWS Encryption SDK protects the data keys that encrypt your data by encrypting them under one or more master keys. By providing a framework to encrypt data keys with more than one master key, the AWS Encryption SDK helps make your encrypted data portable.

For example, you can encrypt data under multiple AWS Key Management Service (AWS KMS) customer master keys (CMKs), each in a different AWS Region. Then you can copy the encrypted data to any of the regions and use the CMK in that region to decrypt it. You can also encrypt data under a CMK in AWS KMS and a master key in an on-premises HSM, enabling you to later decrypt the data even if one of the options is unavailable.

A Formatted Message that Stores Encrypted Data Keys with the Encrypted Data

The AWS Encryption SDK stores the encrypted data and encrypted data key together in an encrypted message that uses a defined data format. This means you don't need to keep track of or protect the data keys that encrypt your data because the AWS Encryption SDK does it for you.

With the AWS Encryption SDK, you define a master key provider (Java or Python) or a keyring (C or JavaScript) that determines which master keys you use to protect your data. Then you encrypt and decrypt your data using straightforward methods provided by the AWS Encryption SDK. The AWS Encryption SDK does the rest.

Compatibility With Encryption Libraries and Services

The AWS Encryption SDK is supported in several programming languages. All language implementations are interoperable. You can encrypt with one language implementation and decrypt with another. Interoperability might be subject to language constraints. If so, these constraints are described in the topic about the language implementation. Also, when encrypting and decrypting, you must use compatible keyrings, or master keys and master key providers. For details, see Keyring Compatibility.

However, the AWS Encryption SDK cannot interoperate with other libraries. Because each library returns encrypted data in a different format, you cannot encrypt with one library and decrypt with another.

DynamoDB Encryption Client and Amazon S3 Client-Side Encryption

The AWS Encryption SDK cannot decrypt data encrypted by the DynamoDB Encryption Client or Amazon S3 client-side encryption. And these libraries cannot decrypt the encrypted message the AWS Encryption SDK returns. 

AWS Key Management Service (AWS KMS)

The AWS Encryption SDK can use AWS KMS customer master keys (CMKS) and data keys to protect your data. For example, you can configure the AWS Encryption SDK to encrypt your data under one or more CMKs in your AWS account. However, you must use the AWS Encryption SDK to decrypt that data.

The AWS Encryption SDK cannot decrypt the ciphertext that the AWS KMS Encrypt or ReEncrypt operations return. Similarly, the AWS KMS Decrypt operation cannot decrypt the encrypted message the AWS Encryption SDK returns.

For help deciding which library or service to use, see How to Choose an Encryption Tool or Service in AWS Cryptographic Services and Tools.

Where to find more information

If you're looking for more information about the AWS Encryption SDK and client-side encryption, try these sources.

For information about implementations of the AWS Encryption SDK in different programming languages.

If you have questions or comments about this guide, let us know! Choose the feedback link in the lower-right corner of the page or the GitHub link in the upper-right corner of the page. You can also file an issue in the aws-encryption-sdk-docs GitHub repository for this guide.

The AWS Encryption SDK is provided free of charge under the Apache license.