4

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

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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
4

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.