I'm encrypting a file using openssl with the following command:
openssl enc -aes-128-cbc -in text.txt -out text.enc -pass file:key.bin
where key.bin is a key generated with the command
openssl rand 16 -out: key.bin
For retrieving the salt, key and IV derived from key.bin I'm using:
openssl enc -aes-128-cbc -pass file:key.bin -d -P -in text.enc
Each time I'm running this command I get the same salt, key and iv.
However, I need to do it in java. Can you please let me know if it is pe possible to retreive these infos in java just passing the encrypted file and the key file?