password protect zip files
I dont have the option -P enabled on my host, but i was wondernig if there was another way of password protecting zip files? like some kind of htaccess or something
os* rh, slack ( just incase ) |
You could use openssl to encrypt the zip file.
|
hmm i never even tried that.. can you tell me how to do this.. or maybe a site on where i can read about this
|
At first you should install openssl - the easiest would be to use the package that ships with your distribution. (Sources can be found on www.openssl.org)
To encrypt a file: openssl enc -e -cipher -in clear file -out encrypted file (The -e option is standard and therefor optional) This will prompt for a password an encrypt the given file. Without the "-in" and "-out" option openssl will read from stdin and write to stdout. To decrypt a file: openssl enc -d -cipher -in encrypted file -out clear file The cipher (and mode) to be used must be specified. http://en.wikipedia.org/wiki/Block_c...s_of_operation gives a good introduction to block ciphers and the modes of operation. The blowfish cipher in cbc mode is a good choice ( "-cipher" = "-bf-cbc" or just "-bf" as cbc is the default). The enc command of openssl has it's own man page ("man enc" or http://www.openssl.org/docs/apps/enc.html). BTW: If security matters you should not specify the password on the commandline as it will be saved to you shell history and displayed by programs like ps. Hope that helps |
All times are GMT -5. The time now is 09:27 PM. |