title: Hide/encrypt password in bash file to stop accidentally seeing it
body: <p>Sorry if this has been asked before, I did check but couldn't find anything...</p>
  
  <p>Is there a function in Unix to encrypt <em>and</em> decrypt a password in a batch file so that I can pipe it into some other commands in a bash file?</p>
  
  <p>I realise that doing this provides no real security, it is more to stop someone accidentally seeing the password if they are looking at the script over my shoulder :)</p>
  
  <p>I'm running on Red Hat 5.3.</p>
  
  <p>I have a script which does something similar to this:</p>
  
  <pre><code>serverControl.sh -u admin -p myPassword -c shutdown
  </code></pre>
  
  <p>and I would like to do something like this:</p>
  
  <pre><code>password = decrypt("fgsfkageaivgea", "aDecryptionKey")
  serverControl.sh -u admin -p $password -c shutdown
  </code></pre>
  
  <p>This doesn't protect the password in any way, but does stop someone from accidentally seeing it over my shoulder.</p>