Ever needed to secure your files in a fast and simple way ? Then look no further because Safe is the ultimate encryption app that you'll ever need. Safe features industry strength AES256 GCM encryption while being very easy to use and very fast, which makes it perfect for daily use. You can now secure your files, e-mail attachments or messages with ease without having to worry about prying eyes.
$ npm install safe-encrypt -g
encrypt a single file
$ safe encrypt 'password' /home/downloads/secret.pdf /home/downloads/secret.safe
encrypt a folder and all files inside a folder recursively
$ safe encrypt 'password' /home/downloads/secret-folder /home/downloads/mydocs.safe
decrypt
$ safe decrypt 'password' /home/downloads/secret.safe /home/downloads
list encrypted files and show encryption info
$ safe list 'password' /home/downloads/secret.safe
The JSON payload consists of an object containing all the encryption information: file names, relative paths, sizes, SHA1 hashes, encrypted chunks info, encryption date
{
"files": [
{
"path": "/relative/file/path",
"hash": "SHA1 file hash",
"size": 0,
"chunks": [
{
"size": 0,
"authTag": "Auth tag in hexadecimal",
"iv": "IV in hexadecimal"
}
...
]
}
...
],
"totalSize": 0,
"date": "Thu Feb 02 2017 00:00:00 GMT+0100 (CET)"
}
This represents the size of the encrypted payload. In order to read the correct amount of data for the payload we need to know the exact size of the encrypted payload data.
- check if the relative decryption destionation path not exists already. we don't want to overwrite already existing files