title: How to secure database (encrypted) password on Android?
body: <p>I have a database containing private information that must only be accessible to my application. I added my database file in assets folder which gets copied over to applications database directory on first time the app runs but "assets" directory and "data" directory(on rooted devices) can be accessed by any other application So I decided to encrypt the database. Android default SQLite Database doesn't provide encryption of the data so I decided to use SQLCipher for android <a href="http://sqlcipher.net/sqlcipher-for-android/" rel="nofollow">http://sqlcipher.net/sqlcipher-for-android/</a>.</p>
  
  <p>Now I have successfully encrypted the database and I can access it using the specific password. But problem remains... Where should I store this password? so that it can only be accessible to my application. </p>
  
  <ol>
  <li>Can't hardcode it as it will be accessible after decompiling it even if it is obfuscated.</li>
  <li>Can't store it in the file system either (assets/raw)</li>
  <li>Can't ask the user to enter it as the user could be a hacker</li>
  </ol>
  
  <p>It is standalone app with no server interaction at all</p>