Skip to content

Instantly share code, notes, and snippets.

@nemik
Created May 3, 2018 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nemik/d365ff209654957650040a4e445ea53b to your computer and use it in GitHub Desktop.
Save nemik/d365ff209654957650040a4e445ea53b to your computer and use it in GitHub Desktop.
/tmp/keyfile - this is your key file. it could be anything, random text. an image. whatever you want
db_dump.sql.gz - this is your gzipped mysql dump
db_dump.sql.gz.enc - this is the output from the encryption, encrypted version if your gzipped DB dump, encrypted with your keyfile
TO ENCRYPT
openssl enc -aes-192-cbc -pass file:/tmp/keyfile -in db_dump.sql.gz -out db_dump.sql.gz.enc
TO DECRYPT
openssl enc -d -aes-192-cbc -pass file:/tmp/keyfile -in db_dump.sql.gz.enc -out db_dump.sql.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment