V
V
viskeg2016-08-15 16:01:14
Python
viskeg, 2016-08-15 16:01:14

How to tighten encryption on S3 using a client key in python?

I have a test case of uploading and downloading a file: pastebin.com/wXNnYtm1
Based on the documentation, I added headers with the key, its md5, and the algorithm:

header = {
            "x-amz-server-side-encryption-customer-algorithm" :
             "AES256",
            "x-amz-server-side-encryption-customer-key" :
             "MAAxAHQAZQBzAHQASwBlAHkAVABvAFMAUwBFAEMAIQA=",
            "x-amz-server-side-encryption-customer-key-MD5" :
             "fUgCZDDh6bfEMuP2bN38mg=="
}

As a result, I get the answer:
reply: 'HTTP/1.1 403 Forbidden\r\n'

But if you remove the headers from both requests, then the file goes back and forth. Can anyone help me figure out what's wrong with me?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question