Search code examples
ruby-on-railsamazon-s3rails-activestorage

ActiveStorage + AWS File Encryption


I went through ActiveStorage docs and did some research but couldn't find anything. Is there a way of configuring it so file encryption/decryption happens automatically upon storage/retrieval?


Solution

  • You can do encryption in two ways,

    1. Client Side Encryption
    2. Server Side Encryption

    Server Side Encryption is for data at rest, when you create the bucket you can configure the encryption keys. AWS will take of the rest.

    You can also encrypt Client side as well. Decryption needs to happen on the client as well.

    It depends how you want to handle it.

    More Documentation on how to configure:

    https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingEncryption.html

    Hope it helps.