Skip to content

Instantly share code, notes, and snippets.

@simonhaenisch
Last active August 20, 2016 08:51
Show Gist options
  • Save simonhaenisch/c8af2843b17c16213a06004fa2209b82 to your computer and use it in GitHub Desktop.
Save simonhaenisch/c8af2843b17c16213a06004fa2209b82 to your computer and use it in GitHub Desktop.
OpenSSL file en-/decryption
#! /bin/bash
file="path/to/file.txt"
# encrypt
openssl enc -aes-256-cbc -e -in "$file" -out "${file}_encrypted" -pass pass:<password>
# decrypt
openssl enc -aes-256-cbc -d -in "$file" -out "${file}_decrypted" -pass pass:<password>
unset file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment