2

I am designing one Custom library, in that library to store the confidential data. For storing the data i have 2 options.

1) shared preferences.

2) Sqlite3 database.

If , i use SharedPreferences with MODE_PRIVATE . It can be accessed by the application developers those who are use my library.

Second option is Sqlite3 Database, Here i can store but still data can be used by the application developers by adding my library.

SO, i been looking for the answers that, Do we have option for setting password for the Database in Android.If yes please guide..

Thank you in advance for the answers.

2 Answers 2

3

Hey the same Problem with me too....

I got an Solution....

The Solution is Dual Passwords :D

Here all we can do is encrypt all the data that is confidential...

Step 1 : Ask user for two Passwords ( Password1 & Password2 ) rather than a username & pass...

Step 2 : You can encrypt all the data using a Password that may be 1 or 2...

Step 3 : to decrypt that data again the same password must be used..

THE PROBLEM SOLVED: The problem is how Can we store the Passwords in the database..

ALL WE DO is encrypt the first password with the other.... ENCRYPTION AND DECRYPTION refer this link

----> http://www.androidsnippets.com/encryptdecrypt-strings <----

JUST USE THAT it works like charm

SO FINALLY HOW THE PROCESS GOES IS

  1. Ask for two passwords...
  2. encrypt one with other then compare the hash with the one in database
  3. continue to next
  4. Beware decrypt all the data before you present to user.....
Sign up to request clarification or add additional context in comments.

1 Comment

@SagarNayak you can use the following github.com/scottyab/AESCrypt-Android
2

The company behind SQLite provides a commercial solution which you can use.

However, SQLCipher is a free (and open source) alternative that allows you to encrypt your SQLite databases.

5 Comments

I am creating library,(if i am developing application, i can use the SQLcipher - because SqlCipher creates library to load). I don't want add the library with in a library, that will be weird right??
@Naveen ActionBarSherlock uses the supporr library even though it is a library. It is definitely possible.
@Naveen you could always encrypt the data itself using AES or something before you write it to the database, and decrypt it after you read it if you want something dynamic.
Thank you very much, i been looking for what you say now. Please share the tutorial regarding the same.
@Naveen There's an SO question on it here: stackoverflow.com/q/6788018/1069068. Many more are there too, which Google can help you with

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.