Can someone explain the difference between the use of these switches on an OpenSSL encryption?
I am encrypting a large file, using a random key and then encrypting that key, using the public key from the recipients Certificate. Here's an example Batch file:
::Generate encryption Key
openssl rand -base64 32 > Key.bin
:: Encrypt Payload Zip File
openssl enc -aes-256-ecb -kfile key.bin -in Payload.zip -out xxx_Payload
::Encrypt Key used above with Public certificate
openssl rsautl -encrypt -inkey certkey.pem -pubin -in
key.bin -out KeyB_Key
I have also tried this using the -Pass file:key.bin switch.
In both cases my submission to a partner has been rejected. In examples they provide they use -K and a hex string on the encryption.
My question is, what's the difference between what I'm doing and what their example is? Also, if I use a hex string, how do I then encrypt that? Does it have to be converted back to characters prior to encryption?