Moor: Encryption Support

Created on 26 Jun 2019  路  4Comments  路  Source: simolus3/moor

I'm looking for database encryption support,

Is this planned for this library?

Most helpful comment

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!

All 4 comments

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.

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.

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.

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Beloin picture Beloin  路  4Comments

Holofox picture Holofox  路  4Comments

kira1752 picture kira1752  路  3Comments

angel1st picture angel1st  路  4Comments

VadimOsovsky picture VadimOsovsky  路  3Comments