To set a password for AES-256-CBC encryption, you specify it during the encryption process using the OpenSSL command. Here’s how to do it:
-
Use the following command to encrypt a file (e.g.,
secret.txt):openssl enc -aes-256-cbc -salt -in secret.txt -out secret.enc -pbkdf2 -
When you run this command, OpenSSL will prompt you to enter a password. This is where you set your AES-256-CBC password. Type your desired password and press Enter. You will be asked to confirm the password by typing it again.
-
After entering and confirming the password, OpenSSL will encrypt the file and save it as
secret.enc.
Remember to choose a strong password, as it will be used to encrypt and decrypt the file.
