howtos:file_encryption_with_openssl
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | howtos:file_encryption_with_openssl [02/12/2018 21:34] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | Encrypt file: | ||
+ | < | ||
+ | $ openssl aes-256-cbc -salt -in file-test -out file-test.aes | ||
+ | enter aes-256-cbc encryption password: | ||
+ | Verifying - enter aes-256-cbc encryption password: | ||
+ | </ | ||
+ | |||
+ | Decrypt file: | ||
+ | |||
+ | < | ||
+ | $ openssl aes-256-cbc -d -in file-test.aes -out file-test-dec | ||
+ | </ | ||
+ | |||
+ | Encrypt file and convert it to Base64: | ||
+ | |||
+ | < | ||
+ | $ openssl aes-256-cbc -a -salt -in file-test -out file-test-64 | ||
+ | </ | ||
+ | |||
+ | And this way to decrypt it: | ||
+ | |||
+ | < | ||
+ | $ openssl aes-256-cbc -d -a -in file-test-64 -out file-64.dec | ||
+ | </ | ||
+ | |||
+ | Append password onto the encrypt command: | ||
+ | |||
+ | < | ||
+ | $ openssl aes-256-cbc -a -salt -in file-test -out file-test-64 -k password | ||
+ | </ | ||
+ | |||
+ | Encrypt one-liner with password from a file: | ||
+ | |||
+ | < | ||
+ | $ for f in * ; do [ -f $f ] && openssl aes-256-cbc -salt -in $f -out $f.enc -pass file: | ||
+ | </ | ||
+ | |||
+ | Encrypt one-liner with password in commandline: | ||
+ | |||
+ | < | ||
+ | $ password=" | ||
+ | </ | ||
+ | |||
+ | Hashes: | ||
+ | |||
+ | < | ||
+ | $ openssl sha1 file-test-64 | ||
+ | SHA1(eapol-64)= afc594f26ca0878073769d24f8c04fe35f2bf8b3 | ||
+ | </ | ||
+ | |||
+ | Hash of files in current directory: | ||
+ | |||
+ | < | ||
+ | $ ls * | xargs openssl sha1 | ||
+ | </ | ||
+ | |||
+ | Replace " | ||
+ | |||
+ | |||
+ | ---- | ||
+ | Source: http:// |
howtos/file_encryption_with_openssl.txt · Last modified: 02/12/2018 21:34 by 127.0.0.1