Program a Cipher example I found on StackOverflow
How to encrypt files with Ruby? was asked June 15th, 2012. I found the answers useful so I coded up an example with a small twist. I save the cipher.key and cipher.id to a hash and the persist the hash to a yaml file.
The command below creates aes-256-cbc.yaml
./new-key-and-iv.rb
file.yaml is encrypted and written test01.enc
./encrypt.rb
test01.enc is decrypted and writtend to test01.dec
./decrypt.rb
file.yaml and test01.dec are identical if you ran these steps in order.
A one-stop program to encrypt (test00.enc) and decrypt (test00.dec) file.yaml
./both.rb