Generate 256bit aes key and 128 bit iv: openssl rand -hex 32 openssl rand -hex 16 Encrypt the file plaintext.txt with the key and iv openssl enc -aes-256-cbc -in plaintext.txt -out b-enc-aes.txt -K cddf0c7f664624fd0b604c622a2c670dffc3fdd7859a7cdd2377d1ba2ab86f89 -iv 30579741743af76bdd06ec45b12ee6d7