Last Updated: February 25, 2016
·
1.016K
· Gabriel Falcão

AES-256 CBC encryption for fun and profit

Generating a new encryption key

openssl rand -base64 512 | tr -d '\r\n' > ./key-dir/production-secret-key.aes256

Encrypting a file

openssl aes-256-cbc -a -salt -in production.tar.bz2 -out production.tar.aes256 -pass file:./key-dir/production-secret-key.aes256

Decrypting a file

openssl aes-256-cbc -d -a -salt -in production.tar.aes256 -out production.tar.bz2 -pass file:./key-dir/production-secret-key.aes256

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

Most application security programs still stop at the repository. The page a visitor loads can run third-party scripts that read the DOM, change a checkout, or steal a session after the deploy already looks clean.

Security insights from Cside