I'm using openssl
with aes-256-cbc
encryption to encrypt a file. The password is on the first line of the file and the encryption script automatically reads the first line of the file for encryption. Is this procedure secure? OpenSSL stores the salt at the first 8 bytes of the file.
The file looks like this: 1: randomly_generated_password 2: data 3: data ...
And the command to encrypt the file is as follows:
openssl aes-256-cbc -a -salt -in data.txt -out data.txt.enc -k 'head -n 1 data.txt'
openssl enc
;openssl
does about 50 other things as well. And it stores the salt in the second 8 bytes; the first 8 bytes are the fixed stringSalted__
. @otus it's a different file; see-kfile
inman enc
or openssl.org/docs/manmaster/apps/enc.html and-pass file:
inman openssl
or openssl.org/docs/manmaster/apps/openssl.html . $\endgroup$