Last active
February 14, 2019 20:58
-
-
Save pgolding/faf7bebeb2eac569a711d78c55b74d7d to your computer and use it in GitHub Desktop.
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
{ | |
"cells": [ | |
{ | |
"metadata": { | |
"trusted": true, | |
"collapsed": false | |
}, | |
"cell_type": "code", | |
"source": "import boto3\nimport base64\ncoded_string = 'AQICAHi2lGQRWfF/2tFFzi7MPPllNABAZ0cDWYFr+Ep2i7FCIQGAf/IV2RS+KoNWi7qbxa6NAAAAgzCBgAYJKoZIhvcNAQcGoHMwcQIBADBsBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDOJngaSZl90g0zJaVwIBEIA/zksHi1c2AcWO9D0WRRKe/W7GMkLdXezmPfzLYEVRwiKLfX68/x6ovUsh+iDB9Z0IyI/uRb6v4aBwHxAVVvVG'\ndec = base64.b64decode(coded_string)", | |
"execution_count": 6, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"trusted": true, | |
"collapsed": true | |
}, | |
"cell_type": "code", | |
"source": "c = boto3.client('kms', region_name='us-east-1')", | |
"execution_count": 8, | |
"outputs": [] | |
}, | |
{ | |
"metadata": { | |
"trusted": true, | |
"collapsed": false | |
}, | |
"cell_type": "code", | |
"source": "c.decrypt(CiphertextBlob=bytes(dec))", | |
"execution_count": 10, | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"data": { | |
"text/plain": "{u'KeyId': u'arn:aws:kms:us-east-1:403511221862:key/a47ff36d-360f-4603-8d45-53b8bea96758',\n u'Plaintext': 'a47ff36d-360f-4603-8d45-53b8bea96758',\n 'ResponseMetadata': {'HTTPHeaders': {'content-length': '150',\n 'content-type': 'application/x-amz-json-1.1',\n 'x-amzn-requestid': '18f9a4a8-da70-4967-8fc7-8754dfa6be3c'},\n 'HTTPStatusCode': 200,\n 'RequestId': '18f9a4a8-da70-4967-8fc7-8754dfa6be3c',\n 'RetryAttempts': 0}}" | |
}, | |
"metadata": {}, | |
"execution_count": 10 | |
} | |
] | |
}, | |
{ | |
"metadata": { | |
"trusted": true, | |
"collapsed": true | |
}, | |
"cell_type": "code", | |
"source": "", | |
"execution_count": null, | |
"outputs": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"name": "conda-env-napkin-api-py", | |
"display_name": "Python [conda env:napkin-api]", | |
"language": "python" | |
}, | |
"language_info": { | |
"version": "2.7.13", | |
"codemirror_mode": { | |
"version": 2, | |
"name": "ipython" | |
}, | |
"mimetype": "text/x-python", | |
"file_extension": ".py", | |
"name": "python", | |
"pygments_lexer": "ipython2", | |
"nbconvert_exporter": "python" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment