AES256 encryption and decryption file(s) with openssl

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


journey
    title openssl aes-256 file encryption
    section on Console
      openssl : 3: use case
      aes-256-cbc: 4: use case
      file: 5: use case
      secret: 6: use case

Overview

  • openssl
    • aes-256 algorithm
      • file
        • encrytion
        • decryption
        • txt,yaml,tar.gz,bzip, zip
      • passphrase protected

AES256 file encryption

encrypt file secret.txt with openssl

openssl aes-256-cbc -a -salt -pbkdf2 -in secrets.txt -out secrets.txt.enc

info: give your password double to protect encryption

journey
    title openssl aes-256 file decryption
    section on Console
      openssl : 3: use case
      aes-256-cbc: 4: use case
      encrypted file: 5: use case
      secret: 6: use case

decrypt file secret.txt.enc openssl

openssl aes-256-cbc -d -a -pbkdf2 -in secrets.txt.enc -out secrets.txt

info: you will be ask for your given protected given password

you can also encrypt tar.gz files, so if you have multiple files to encrypt than compress it with zip , bzip or tar.gz and than you can encrypt it

mindmap
  root((openssl))
    algorithm
      aes-256-cbc
        file
          encryption
            protection
              your password
          decryption
            proctection
              your password

thanks for reading


Aysad Kozanoglu