openssl aes-256 text encryption / decryption interactive mode

%%{
  init: {
    'theme': 'base',
    'themeVariables': {
      'primaryColor': '#3ed72b',
      'primaryTextColor': '#000',
      'primaryBorderColor': '#000',
      'lineColor': '#fff',
      'secondaryColor': '#e6f01b',
      'tertiaryColor': '#fff'
    }
  }
}%%


journey
    title openssl aes-256  encryption interactive mode
    section on Console
      openssl : 5: use case
      aes-256-cbc: 5: use case
      enter text: 5: use case
      enter secret: 5: use case
      hash: 5: use case

Overview

  • console interactive mode
    • openssl
      • aes-256 algorithm
      • encryption
      • decryption
      • aes-256 hash
      • passphrase protected

openssl AES-256 interactive mode encryption and decryption

aes-256 encryption interactive mode with openssl

unset -v PASS
unset -v STRING
echo -e "\n\n Text to encrypt:"; read STRING;
echo -e "\n\nPassword: "; read -s PASS;
echo -e "\n"; echo Encrypted:;
printf "$STRING" | openssl enc -e -base64 -A -a -pbkdf2 -aes-256-cbc -pass pass:"$PASS";
echo -e "\n\n"

aes-256 decryption interactive mode with openssl

unset -v PASS
unset -v STRING
echo -e "\n\n Encrypted Hash:"; read STRING;
echo -e "\n\n Password: "; read -s PASS;
echo -e "\n\nDecrypted:";
printf "$STRING" | openssl enc -d -base64 -A -aes-256-cbc -a -pbkdf2 -pass pass:"$PASS"
echo -e "\n\n"

demo:

mindmap
  root(console)
    enter string
      enter password
        openssl
          aes-256 encryption
            output aes-256 hash
          aes-256 decryption
             output plain text string