The Python Oracle

boto encryption key with amazon s3

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Realization

--

Chapters
00:00 Boto Encryption Key With Amazon S3
00:39 Accepted Answer Score 9
01:51 Thank you

--

Full question
https://stackoverflow.com/questions/1462...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #amazons3 #boto

#avk47



ACCEPTED ANSWER

Score 9


The two functions you probably mean are set_contents_from_filename and set_contents_from_file

If possible, I want to know, which is the key that is being used to encrypt the file.

The current server-side-encryption method is AES256 (Source), the key is generated on the server-side.

If encryption is set to true, the encryption takes place in server side right?

Yes, data is uploaded, then encrypted on the server side. If you wish, you can also encrypt the data on your client before uploading, but this would mean, for reading, you also have to decrypt it on the client. If you don't want to transfer data plain from and to the s3 servers, you can use the SSL endpoints

Encrypted, while downloading, the objects are decrypted in s3 and then start to download? Or does the decryption happen while downloading?

After uploading a file with the encryption header set, s3 will encrypt your file for storage and decrypt it when requested. The file is saved in a encrypted version on the physical storage

Workflow illustration from the AWS blog

Encryption workflow, from the amazon blog