I\'m not very familiar with encryption of files in java or openssl for that matter. I know the basics from school but have never actually implemented it.
Now I\'ve b
The random byte array code is fine but why Base64 encode the random bytes, that is really only neccessary for display of perhaps use where only ASCII charactrers are required.
For AES encryption see the Java docs for javax.crypto.
Use SecureRandom
to create the iv and prepend it to the encrypted data, it does not need to be secret. On decryption just pick the iv from the data to use for the iv.