Skip to content

Instantly share code, notes, and snippets.

@cy-lee
Created October 30, 2021 08:03
Show Gist options
  • Save cy-lee/6d855e42fae3ddc542ca3ad47d950d27 to your computer and use it in GitHub Desktop.
Save cy-lee/6d855e42fae3ddc542ca3ad47d950d27 to your computer and use it in GitHub Desktop.
Simple string encode/decode using OpenSSL 1.1.1f in command line
# encode "asdf", use aes-256-cbc cipher, password is login, output format is base64 encoded
echo asdf | openssl enc -aes-256-cbc -base64 -pass pass:login -pbkdf2
# decrypt base64 string back to string
echo U2FsdGVkX1//XT7B0wrXH0+3hqMz7jJ+6ss5QStdI/k= | openssl enc -d -aes-256-cbc -base64 -pass pass:login -pbkdf2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment