Skip to content

Instantly share code, notes, and snippets.

View not-eexto's full-sized avatar
👽
Working

Paolo Lazzaroni not-eexto

👽
Working
View GitHub Profile
@johnsmclay
johnsmclay / 0-How-To.md
Last active July 9, 2024 19:46
Stream encrypting/decrypting along with gzipping, etc. originally for database dumps

When backing up databases/table to files I needed to have them encrypted for security and compliance. But there were a few concerns:

  1. I didn't want the file to be in plaintext, ever.
  2. I didn't want that same user to be able to decrypt the file later in case the account was compromised.

So, Pub/Priv is great for #2. Unfortunately, Pub/Priv is not made for large files, therefor I decided follow this process:

  1. Generate symetric key
  2. Encrypt files in-line w/ symetric key using AES-256-CBC