Skip to content

Instantly share code, notes, and snippets.

@vovandodev
Created July 6, 2017 14:58
Show Gist options
  • Save vovandodev/6e0f61fe7d9e9099fa8259ec7548e411 to your computer and use it in GitHub Desktop.
Save vovandodev/6e0f61fe7d9e9099fa8259ec7548e411 to your computer and use it in GitHub Desktop.
#!/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