def decrypt(message):
    '''decrypt leverages KMS decrypt and base64-encode decrypted blob

        More info on KMS decrypt API:
        https://docs.aws.amazon.com/kms/latest/APIReference/API_decrypt.html
    '''
    try:
        ret = kms.decrypt(
            CiphertextBlob=base64.decodestring(message))
        decrypted_data = ret.get('Plaintext')
    except Exception as e:
        # returns http 500 back to user and log error details in Cloudwatch Logs
        raise Exception("Unable to decrypt data: ", e)

    return decrypted_data
decrypt leverages KMS decrypt and base64-encode decrypted blob

        More info on KMS decrypt API:
        https://docs.aws.amazon.com/kms/latest/APIReference/API_decrypt.html