Created
December 19, 2016 06:12
-
-
Save liks79/89ebb7ff125cb10a5e78b8dd2055c67b to your computer and use it in GitHub Desktop.
AWS KMS enc/dec code snippet
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
import boto3 | |
keyId = '<Key ARN>' | |
text = 'Hello Cloud!' | |
kms = boto3.client('kms', region_name='ap-northeast-1') | |
enc = kms.encrypt(KeyId = keyId, Plaintext = text)['CiphertextBlob'] | |
print (enc) | |
dec = kms.decrypt(CiphertextBlob = enc)['Plaintext'] | |
print (dec) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment