Skip to content

Instantly share code, notes, and snippets.

@sat0yu
Created April 10, 2021 05:12
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 sat0yu/208bddb5aec1663bcfb465b474d7d3c9 to your computer and use it in GitHub Desktop.
Save sat0yu/208bddb5aec1663bcfb465b474d7d3c9 to your computer and use it in GitHub Desktop.
Openssl
# -e: encryption, -base64 (-a): use base64 encoding/decoding, -pass: `pass:xxx` sets the password `xxx` to encrypt/decrypt, -p: print salt, key, IV
echo "hello" | openssl enc -aes-128-cbc -e -base64 -pass pass:test -p
# salt=FE03CBE926FC4070
# key=FFF339A34C98ED8D8B8843E3F1846104
# iv =EAEAD799A571F360BA1C17B335E2701F
# U2FsdGVkX1/+A8vpJvxAcFEj7ilI/zfrmA3EZ5VQUeY=
# -d: decryption
echo "U2FsdGVkX1/+A8vpJvxAcFEj7ilI/zfrmA3EZ5VQUeY=" | openssl enc -aes-128-cbc -d -base64 -pass pass:test -p
# salt=FE03CBE926FC4070
# key=FFF339A34C98ED8D8B8843E3F1846104
# iv =EAEAD799A571F360BA1C17B335E2701F
# hello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment