Cold Storage with One-Way RSA Encryption #43
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "coldstorage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a cold storage feature for one-way encryption on disk of sensitive files.
The first use case: if a user is challenged to upload a secondary photo ID for certification, then once approved, the image they uploaded is written to cold storage with one-way encryption where the keys to decode it are not stored on the web server (to reduce risk in case of a hack or data breach).
To Do:
Some notes:
Initialization
The cold storage keys are initialized automatically when the web server reboots after this update has been installed.
The directory
./coldstorage/keys
is created and private.pem and public.pem are written, which will be the RSA keys. The public key is also written to settings.json. Note: the site only uses the key from settings.json, so the coldstorage/keys/ folder can be removed from the server.Importantly, the private.pem file SHOULD be removed from the server for safety.
The admin dashboard page will show a warning if the private.pem file is still at its original location.
Encryption
When a file is moved into cold storage:
Because the production web server only has the RSA public key, the generated AES key is not able to be decrypted by the web server. The .aes + .enc output files are the pair needed to recover the original file from cold storage.
Decryption
Decrypting a file from cold storage is an action done manually using the private RSA key file which is kept offline from the web server.
The
nonshy
Go program has a coldstorage sub-command that enables decoding it. Usage is like:The requirements for this command are:
The decrypt algorithm then is basically: