title: Two way DB encryption secure even from the Admin
body: <p>I have an interesting encryption problem at hand. I do not know if it can be solved but here goes:</p>
  
  <p>A database is to contain sensitive user information. As such, the user information must be encrypted (two way encryption). The user has a login / password and these may be used in the two way encryption. Now, the encryption is to be designed in such a way that even the administrator viewing the database tables should not be able to make sense of the user information.</p>
  
  <p>However, the design has to take care of the cases where the user may forget her password. If the password is used for encryption, forgetting the password means the information is lost - not wanted. If the user password itself is stored in the database using a two way algorithm (instead of a one way hash) with a key hardcoded in the script, the administrator can discover the hardcoded key by looking at the script (the administrator of course has access to the script).</p>
  
  <p>Does anybody know a way out of this?</p>
  
  <p>PS: This is a real problem. My company is an absolute security fanatic (ISO 27001 and all) and I have been entrusted to design a system with the above mentioned functionality. By the way, I am using a PHP script and MySQL.</p>
  
  <p><strong>EDIT</strong>: Perhaps it was not clear earlier, the user needs to see / edit this user information on a day-to-day basis.</p>