Comments (7)
The workaround worked for me, but I had to base64 encode the Plaintext as well.
encrypted=kms.encrypt(KeyId='', Plaintext='Test')
decrypted=kms.decrypt(CiphertextBlob=base64.b64encode(encrypted['CiphertextBlob']).decode('utf-8'))
base64.b64encode(decrypted['Plaintext']).decode('utf-8')
from boto3.
@bilalaslam this appears to be a bug in Botocore where the CiphertextBlob
should automatically be base64-encoded. For example, this appears to work for me:
import base64
kms.decrypt(CiphertextBlob=base64.b64encode(result['CiphertextBlob']).decode('utf-8'))
You can use that as a workaround for now, but once we make the underlying fix you'll need to remove the manual base64-encoding.
from boto3.
I can confirm the bug on my end too.
from boto3.
@spgta does the workaround work for you? This should get fixed in Botocore soon.
from boto3.
This works for me:
encrypt:
kms = boto3.client("kms")
e = kms.encrypt(KeyId=self.keyid,EncryptionContext={""},Plaintext=encoded_file)
self.objectBody = base64.b64encode(e['CiphertextBlob']).decode("utf-8")
decrypt:
kms = boto3.client("kms")
decrypted_file = kms.decrypt(CiphertextBlob=enc_string,EncryptionContext="")
from boto3.
@spgta, @jstnblau, @bilalaslam this should be fixed upstream with boto/botocore#397, which was just merged. It'll go out with the next release.
from boto3.
Released in version 0.0.5
from boto3.
Related Issues (20)
- Please provide a way to get an SNS topic ARN by topic name HOT 3
- cloudformation describe_change_set with IncludePropertyValues=True response lacking StatusReason HOT 3
- boto3 inspectorv2 list_findings maxResults example is over the undocumented limit HOT 2
- getting a presigned URL for a key with a leading slash returns a URL whose path starts with a double slash HOT 2
- 'Contents' key in S3 paginator's page is assumed to be there HOT 2
- Add DryRun parameter to Boto3 RDS client methods. HOT 2
- AWS Boto3 documentaion has start_directory_listing for transfer but is missing HOT 1
- Bucket name sometimes missing in the S3 URL - causing failures for the same bucket and code that was previously successful for operations like get object and put object. HOT 4
- `--ssl-no-verify` / `--ca-bundle` / `AWS_CA_BUNDLE` is not honored for `AWS_CONTAINER_CREDENTIALS_FULL_URI` HOT 5
- metadataColumns not acceptable parameter for user-personalization-v2 campaign HOT 2
- head_bucket returns ResponseMetadata without BucketRegion HOT 3
- cloudformation `describe_stacks` blocks stack deletion HOT 5
- Generate V2Token in STS HOT 7
- When calling DynamoDB client `list_exports` with NextToken receive a ValidationException HOT 2
- invoke_agent API on bedrock-agent-runtime inconsistently returns retrievedReferences HOT 2
- list_q_apps Always Unauthorized HOT 11
- SES send email example doesn't work HOT 2
- Certain operations not working with S3-compatible backend HOT 4
- [Feature Request] Query Bedrock model maxTokens limit HOT 2
- Unable to call RevokeSecurityGroupIngress (incorrect parameters being passed) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boto3.