title: Secure way to store password in Windows
body: <p>I'm trying to protect a <strong>local database</strong> that contains sensitive info (similar to <a href="https://stackoverflow.com/questions/9286398/store-password-in-application">this question</a>, only <strong>for delphi 2010</strong>)</p>
  
  <p>I'm using <a href="http://www.yunqa.de/delphi/doku.php/products/sqlite3/index" rel="nofollow noreferrer">DISQLite component</a>, which does support AES encryption, but I still need to protect this password I use to decrypt &amp; read the database.</p>
  
  <p>My initial idea was to generate a random password, store it using something like DPAPI (<code>CryptProtectData</code> and <code>CryptUnprotectData</code> functions found in Crypt32.dll), but I couldn't find any example on that for Delphi</p>
  
  <p>My question is: how can I safely store a randomly generated password? Or, assuming the DPAPI road is secure, how can I implement this DPAPI in Delphi?</p>