Created
November 5, 2018 11:49
-
-
Save RafalSladek/e4a16c867c4fdf0f55a8c692b0193333 to your computer and use it in GitHub Desktop.
How to de-/encrypt password with KMS
This file contains 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
#!/bin/bash | |
## How to encrypt password with KMS? | |
aws kms encrypt --key-id <KMS_KEY_ID> --plaintext fileb://password.txt --output text --query CiphertextBlob | |
## How to decrypt password with KMS? | |
echo "<DECRYPTED_SECRET_HERE>" | base64 --decode > password.base64 | |
aws kms decrypt --ciphertext-blob fileb://password.base64 --output text --query Plaintext | base64 --decode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment