Catalogue
Encrypting and Decrypting with the aws-cli KMS

Encrypting and Decrypting with the aws-cli KMS

🌐 日本語で読む

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/

Author

Kenzo Tanaka

Posted on

2020-08-14

Licensed under