Simple file/stream encryption using OpenSSL Create and store a 512-byte random encryption key named secret: $ mkkey secret Encrypt the contents of file with the secret key and write it to file.enc: $ encrypt secret < file > file.enc