title: Encrypt/Decrypt a string based on a salt key
body: <p>I was wondering if it was possible to hold an encrypted text field within my database and have the ability to decrypt this piece of text based on a salt and authorized password? </p>
  
  <p>For example: </p>
  
  <pre><code>$Salt = $_POST['Salt']; 
  $Password = $Query_Results['Password'];
  
  if ($salt == $Stored_Salt AND $Authorized_Password == $Password){
    //Perform a decryption of the stored results
     echo $Decrypted_TextField;
  }
  </code></pre>
  
  <p>I am in the process of creating a completely encrypted/encoded database. Nothing will be plain text apart from the integer fields for the identifiers. Everything else will be encrypted/encoded.. Many will use a one way encryption, but some fields need to house a two way encryption type. </p>
  
  <p>I cannot house non-encrypted text in the database. Everything needs to be encrypted before storing. But the approach to this is an unknown process to me. So I was wondering if I could get some assistance on where to start</p>