It would be nice to support encrypting multiple files out of the box. The CLI signature could become staticrypt <filenames> [options], and we could do
staticrypt foo.html -p password
staticrypt foo.html bar.html -p password
staticrypt fooDirectory/ bar.html -p password -r # -r flag for recursive in directory
staticrypt *.html -p password
This would require a way to specify the output and a sensible default. A few ideas:
-
output next to the files with _encrypted in the name: dir/foo.html => dir/foo_encrypted.html. This might be convenient for one file, not so much for many files since we have mixed encrypted/non-encrypted files, so not easy to push only the encrypted ones
-
output in separate directory, the value of -o is the name of directory with default encrypted
foo.html, dir/bar.html
=> encrypted/foo.html, encrypted/dir/bar.html
-
some sort of pattern to support renaming the files, like dir/foo.html => encrypted/dir/foo_encrypted.html or dir/encrypted.html
Solution 2. looks to me like it's the easiest to set up and the most convenient:
- if you have multiple files: you have a folder of sensitive html files, you encrypt them all into a single folder, and you can upload that folder anywhere
- if you have a single file: the encrypted file is separated from the sensitive file and has the same name
In the case of multiple files, keeping the same names also allows relative link to work out of the box. If foo.html has a link to dir/bar.html, the encrypted foo.html will point to the encrypted dir/bar.html (whereas currently you have to rename the links so the link in plaintext foo.html points to dir/bar_encrypted.html to support links between encrypted pages).
You can also always use -o . to output the file in the current directory, and maybe do a little command line magic to get back the foo_encrypted.html name if you really want to.
Curious to hear any extra thoughts on the topic.
It would be nice to support encrypting multiple files out of the box. The CLI signature could become
staticrypt <filenames> [options], and we could doThis would require a way to specify the output and a sensible default. A few ideas:
output next to the files with
_encryptedin the name:dir/foo.html=>dir/foo_encrypted.html. This might be convenient for one file, not so much for many files since we have mixed encrypted/non-encrypted files, so not easy to push only the encrypted onesoutput in separate directory, the value of
-ois the name of directory with defaultencryptedsome sort of pattern to support renaming the files, like
dir/foo.html=>encrypted/dir/foo_encrypted.htmlordir/encrypted.htmlSolution 2. looks to me like it's the easiest to set up and the most convenient:
In the case of multiple files, keeping the same names also allows relative link to work out of the box. If
foo.htmlhas a link todir/bar.html, the encryptedfoo.htmlwill point to the encrypteddir/bar.html(whereas currently you have to rename the links so the link in plaintextfoo.htmlpoints todir/bar_encrypted.htmlto support links between encrypted pages).You can also always use
-o .to output the file in the current directory, and maybe do a little command line magic to get back thefoo_encrypted.htmlname if you really want to.Curious to hear any extra thoughts on the topic.