I may not be asking the right question. I am fairly new to data encryption.
I am currently being sent encrypted data that's stored as follows: [ [keysize] [key encrypted with public key] [ivsize] [iv] [data encrypted with supplied key earlier in file] ]
To decrypt (in my C# code), I have to first read the key out. I then decrypt that key using my certificate's private key. Afterwards, I read the IV and use it with the newly decrypted key to decrypt the data using Rijndael AES decryption. (to note: it uses AES/CBC/PKCS7 padding)
This works great for receiving the encrypted data and decrypting it. However, I would like to generate the exact same type of encrypted file they are sending me and have exhausted myself to the point of total confusion with my various trial and errors. I was told by a colleague that this is a common encryption tactic.
I would like to know if it would be possible to generate the encrypted file using the openssl utility rather than writing code?