I would like to encrypt files using a key file instead of a password. What I would do is:
1) Generate X random bits using openssl rand X > mykey
2) openssl enc -aes-256-cbc -in secretfile -out secretfile.enc -k mykey
Is this secure? How many bits should the key file should be?