Skip to content

feat: database encryption using sqlcipher#539

Closed
therajanmaurya wants to merge 1 commit intoopenMF:masterfrom
therajanmaurya:sqlcipher
Closed

feat: database encryption using sqlcipher#539
therajanmaurya wants to merge 1 commit intoopenMF:masterfrom
therajanmaurya:sqlcipher

Conversation

@therajanmaurya
Copy link
Member

@therajanmaurya therajanmaurya commented Feb 22, 2017

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Apply the MifosStyle.xml style template to your code in Android Studio.

  • Run the unit tests with ./gradlew check to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.


@Override
protected String getCipherSecret() {
return "dbflow-rules";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line of code is the problem, Secret is something that people cannot know. We need to find a way to make it secure.

Copy link
Member Author

@therajanmaurya therajanmaurya Feb 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have two ways to implement

  1. What about if we make the MD5 hash of username and password entered by the user. And save them in the custom data table on the server.
  2. Add an extra screen and give the user to enter the database encryption key after the login and save then on server and double encrypt the key and save in Shared Preference So no one can get the key other than admin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@satyan Suggestion

One of the options could be to use user's password entry to encrypt the key on the client. So you could only decrypt with the help of user.

It adds a layer of entropy to the system. However, could mean that we ask the user for password multiple times..

Android also supports a hardware backed keychain support. You could potentially explore that as well to store the key.

Having a server backed key is a good option too. Except, in offline case, it'd be difficult to obtain. Do not store in shared preferences, as it's stored in a file on the device in clear. Easily obtained.

@therajanmaurya therajanmaurya deleted the sqlcipher branch August 10, 2017 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants