Basic encryption uses a static key to encrypt and decrypt data. It doesn't require AWS credentials and KMS keys.
-
In order to run the examples, you need to have a valid AWS account and credentials configured.
-
You need also set the following environment variables:
KEY_1_ARN
KEY_2_ARN
KEY_1_ARN
and KEY_2_ARN
with the ARN of the KMS keys you want to use for the examples.
Alternatively, you can replace the values in main.go
with the ARN of the keys you want to use.
Do not use MyKey
and MyProvider
in production!
Custom MyKey
implementation for simplicity of demonstration uses base64 encoding for encryption and decryption.