tags:

views:

1010

answers:

2

In my Android application I want to encrypt a db file. How can I do that?

+3  A: 

The DB, normally, is stored in your application directory which is only accessible to the user-id assigned to your application.

I don't think there's any way to explicitly encrypt the DB using the android framework but an easier approach would be to encrypt the information you store in the DB. That works well if your user needs to enter some password to access the application and you can use this password to encrypt your information. But if your application doesn't require any password login then you will have to keep the encryption key in code and the security of your data will be compromised if some decompiles your application and finds the key.

Prashast
i want to say 2 things...1.i have stored the db file in sdcard(because of its size),so only i forced to do the encrpt.2.i need some reference to do the encryption/decryption.Thanks
arams
+2  A: 

Sun has an article that explains how to use AES encryption here. As far as I can tell all of the necessary libraries are available from Android.

fiXedd