title: Decrypt base64 and save in second variable
body: <p>I am trying to write a password security system. (Just a small homesystem to learn some bash scripting) I am able to encrypt the password string and save it to another file. </p>
  
  <p>My next step is to export these encrypted password strings in my shell script and decrypt them to use them in this routine. I found an export solution with simple export commands and I finally saved the encrypted strings to new variables.</p>
  
  <p>How can I decrypt these strings and save them in another variable. I am using openssl and base64 encryption.</p>
  
  <p>This is the source code:</p>
  
  <pre><code>export user=$(cat logindata | head -n1 | tail -n1)
  export passwd=$(cat logindata | head -n2 | tail -n1)
  passwd2=echo -n $passwd | openssl enc -d -base64
  echo "$user"
  echo "$passwd2"
  </code></pre>