openssl for a project and came across two options:
-k passphrase and
-K raw_key (hex). What's the difference between the two options? I've been attempting to port something from
openssl to Python, and the
openssl command I'm using for my basis uses
-k [32-bytes_of_hex_data], which yields an entirely different key is I use the
-p switch to see the key being used.
The password to derive the key from. This is for compatibility with previous versions of OpenSSL. Superseded by the -pass argument.
The actual key to use: this must be represented as a string comprised only of hex digits. If only the key is specified, the IV must additionally specified using the -iv option. When both a key and a password are specified, the key given with the -K option will be used and the IV generated from the password will be taken. It does not make much sense to specify both key and password.
The key is the raw key used for encryption and should be combined with the -iv flag to specify the IV as well.
On the other hand, a password is used to derive the key and IV. How it does so can also be configured through various flags (see -iter, -pbkdf2, -salt). You should also read the Notes section of the man page for more details and recommendations.
The default digest used to generate the key is sha256 as of openssl 1.1.0 (see history section of the man page) but used to be md5.