Java – set password in sqlcipher

I want to create a new encrypted database with sqlcipher. Because of the following link, I don't really explain how to set the key: http://sqlcipher.net/sqlcipher-api/#key

As explained in the documentation, I have to set the key using pragma, but where do I start?

Solution

For Android, you only need to call openorcreatedatabase to provide the encryption key The second parameter is the password that will be used

sqliteDatabase database = sqliteDatabase.openOrCreateDatabase(databaseFile,"test123",null);

The pragma key interface provides the same functionality when using the command line version of sqlcipher

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>