johnjohntheleprechaun / oceanic

https://oceanic.leprechaun.dev/
GNU Affero General Public License v3.0
1 stars 0 forks source link

Add crypto utils #33

Closed johnjohntheleprechaun closed 2 months ago

johnjohntheleprechaun commented 3 months ago

Encryption, decryption, key derivation etc.

johnjohntheleprechaun commented 3 months ago

Ok so, I think I should go back and finish that course on cryptography first....

johnjohntheleprechaun commented 3 months ago

Ok so I figure I use AES-GCM. Nonce storage is a bit tricky, but I think I have a solution, which is to store the document versions nonce at the beginning of the file, like as a header.

johnjohntheleprechaun commented 3 months ago

the document versions nonce

To clarify, I mean that since documents are encrypted with one key (that shouldn't change, at least not often), and versioning is enabled in the s3 bucket, I need to be using a nonce for each version of the document.

johnjohntheleprechaun commented 2 months ago

crypto utils are finished. code is in crypto.ts