Created
June 29, 2016 11:56
-
-
Save pokle/3ba7d08cf7d3c34186791544a78d9f56 to your computer and use it in GitHub Desktop.
How to encrypt / decrypt an Amazon KMS secret
This file contains hidden or 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
#!/usr/bin/env bash | |
KEYID=f0f2af05-6530-4dcf-a7ef-602f5bb8f642 | |
echo hello hello > ExamplePlaintextFile | |
aws kms encrypt --key-id f0f2af05-6530-4dcf-a7ef-602f5bb8f642 --plaintext fileb://ExamplePlaintextFile --output text --query CiphertextBlob | base64 --decode > ExampleEncryptedFile | |
aws kms decrypt --ciphertext-blob fileb://ExampleEncryptedFile --output text --query Plaintext | base64 --decode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment