Amazon Connect Decryption Library for Python
Project description
Required
Python 3.8+
boto3
Install
$ pip install amazon-connect-decryption-lib
Usage
from amazon_connect_decryption_lib import decrypt
ssm_parameter_name = 'CONNECT_INPUT_DECRYPTION_KEY'
encrypted_text = 'AYADeOCM0sgyKxALhzT1Q0fD+FEAXwABABVhd3MtY3J5cHRvLXB1YmxpYy1rZXkAREFxdnNLME55K1J1R3JSR0lLdmFuSVp5Q254RHpNMTY0ZUx4SUt0RE80czR1QWhKRlV2Tm44VExic0p1UnIvb2FnQT09AAEADUFtYXpvbkNvbm5lY3QAJGE1ZWNkNzQ5LTRiZDgtNGE5NC1iZmRlLTI3ZWVmZTRmMTJiMQIAfQ/ZWMphr1+3+vAd9REB07pMkNP4bgQSamOzwmSHX7B3Fx5GX1wlbkys9yC//5WfUy7ikFKVsy1BpyyGZ3gtkw8+etXt6c/TIScjxHP+4pXFGVHPwTeAPNNERMJwu3P5DyZEEflCDIpP6EtcCBlWgNAu4bOTxEDmUdesR1M3xy/BmIK/daUY9A6Z35NKmS1rV3L8kxPwvLzi93m2vwH1YGXcDcxuL3Iwc6YoTpI0ZIpQtNs30yeYBm1NNW3No76Wq6+dxNTRs5O6moaS0SNYoPrVmBImU7xqvHKoiBJeRxyA20rRPNbyrAZw3kcoLxyuhSqcJJS1NKpuUY/XO4i/xMa5C+ZtzfWbsiUF4ApGzkEVZ/m5iMTIFwI6BVlTV60wVMZkqSaQSnJpoC/qOdWK78LxxdBdmL470lWze0J35Wy7VXynpPAqq9tFYA6Lfq2OyOfjDxj1hwOcaIvjO3yeWCH8SPjer6NChYUUWhLt0CObxaJcHyH5YogzknLyiBAvfvVmlJgP8HcLKg8mJM0GQ+aEokISp9HNIyvFqDTwXsRz2OIdOE2a9qrDirkYC/+HEbkka/hYl4nYr+n+Knn/0RCQ8Nwb7oYk7WnZlU1ADCmYIKjotor2hEK/TlcuxXLylJj8ofgbe8HbsEjFMBdG442b1Eun4r4nUZuLZfm33ncCAAAAAAwAABAAxVaVGO1V9GzHfrF+z1YV08Baa+e9WeAKBoDFiP////8AAAAB4doeJ2gezq6CHwv+AAAADMznKid/99jwAREvH4WZtUbQSJSINk1Jes+EmT8AZzBlAjBdmQ6tP1SFucy/R6YrhrTR29AeBK3qF50WMOZ+TC55Yk3J+QAxy3HhSF4zI6mXn5kCMQC2sBABuFsktmfEvfr1EVWGPGtDYaXEk72ZBR6r3TG/opJSaWuoAUkxxAHCUt6gEl4='
plain_text = decrypt(ssm_parameter_name, encrypted_text)
print(plain_text) # output is 112344567789
Usage with AWS Lambda
from amazon_connect_decryption_lib import decrypt
def lambda_handler(event, context):
ssm_parameter_name = 'CONNECT_INPUT_DECRYPTION_KEY'
encrypted_text = event['Details']['ContactData']['Attributes']['EncryptedNumber'] # EncryptedNumber is your contact attribute name.
plain_text = decrypt(ssm_parameter_name, encrypted_text)
print(plain_text)
return {'DecryptResult': plain_text }
Test(for Developer)
$ python -m unittest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file amazon-connect-decryption-lib-0.2.0.tar.gz
.
File metadata
- Download URL: amazon-connect-decryption-lib-0.2.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e65523bd87defabfc40d9b50b353a47bd2dadb86df6214ccd5227117502d36fb |
|
MD5 | 23cbf4bee34663118071159b684eb360 |
|
BLAKE2b-256 | 5e729a939a9f388fbbeeef05731e444db234e096ab14105ea35a71f0a5b92256 |
File details
Details for the file amazon_connect_decryption_lib-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: amazon_connect_decryption_lib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54222769cf335d688c7e419672062b4dc7f7184944cd31907d2bee006cd3406a |
|
MD5 | 4f709aeafc2c701576e773953a66ce8d |
|
BLAKE2b-256 | fcee3e86dd5b4818accd8dfd0ee46e2236253c27cf9d6c7dd10ca84f07e090aa |