Encrypting and Decrypting with the aws-cli KMS
ToC
Just a memo for myself.
Encryption
aws cli ver.1
1 | aws kms encrypt --key-id alias/<kms鍵> --plaintext "<暗号化したい文字列>" --output text --query CiphertextBlob |
aws cli ver.2
1 | aws kms encrypt --key-id alias/<kms鍵> --plaintext "$(echo -n '<暗号化したい文字列>' | base64)" --output text --query CiphertextBlob |
Decryption
1 | aws kms decrypt --ciphertext-blob fileb://<(echo '文字列'|base64 -d) | jq .Plaintext --raw-output |base64 -d |
Encrypting and Decrypting with the aws-cli KMS
https://kenzo0107.github.io/en/2020/08/14/aws-kms-encrypt-decrypt/