Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encryption Support #45

Closed
cadaniel opened this issue Jun 26, 2019 · 4 comments
Closed

Encryption Support #45

cadaniel opened this issue Jun 26, 2019 · 4 comments

Comments

@cadaniel
Copy link

I'm looking for database encryption support,

Is this planned for this library?

@simolus3
Copy link
Owner

This would depend on the underlying database engine. Moor currently uses the sqflite package internally, which doesn't support encryption.
There are some forks which seem to support encryption, but I'm not sure if any of them works well enough. In theory, all that needs to be done is changing this file to use such fork.

@simolus3 simolus3 mentioned this issue Jul 20, 2019
@simolus3
Copy link
Owner

On the develop branch, we now have the encrypted_moor library that supports encryption in the extras/encryption folder. It uses sqflite_sqlcipher as implementation. That library isn't on pub, so the moor bindings probably won't be either - the folder contains instructions on how to use the library.
The encrypted version won't work with the current moor version (1.6), but it will work with the next version. I'll keep the library updated to always work with the latest version of moor after that, and hopefully write some integration tests to verify that soon.

As an alternative, when dart:ffi gets stable and we can ship our own bindings, using SQLCipher might be a viable alternative in the future.

@dinbtechit
Copy link

On the develop branch, we now have the encrypted_moor library that supports encryption in the extras/encryption folder. It uses sqflite_sqlcipher as implementation. That library isn't on pub, so the moor bindings probably won't be either - the folder contains instructions on how to use the library.
The encrypted version won't work with the current moor version (1.6), but it will work with the next version. I'll keep the library updated to always work with the latest version of moor after that, and hopefully write some integration tests to verify that soon.

As an alternative, when dart:ffi gets stable and we can ship our own bindings, using SQLCipher might be a viable alternative in the future.

Looking forward for the encryption feature.

@simolus3
Copy link
Owner

Now that moor 1.7 is released, you can try out an encrypted version by following the instructions at https://github.com/simolus3/moor/tree/master/extras/encryption. The EncryptedExecutor has a password parameter in its constructor which will be used to encrypt the database. As we just change the underlying database engine, all features supported by moor_flutter are supported on that version as well.

As always, if you have any questions or problems, feel free to reply here or open another issue, thanks!

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

No branches or pull requests

3 participants