-
Notifications
You must be signed in to change notification settings - Fork 47
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
Great Job David! #1
Comments
@davbaron That's great to hear! Publishing it was not in my plans but maybe I'll give it a spin again and perhaps publish 1.0 version. |
@davidmartos96 Does your code allow to create encrypted databases or does it require an encrypted db to be there already? |
@hellowtisch It is the same behavior as normal sqflite, you can open a prepopulated db from assets or let the library create an empty one in the device.
The example project not picking up the parameter password, that was my bad. The |
nice! thank you, David! |
The package has been published in pub.dev sqflite_sqlcipher 🎊 🎊 |
Hi.
Thank you in advance. <3 |
@MojtabaTavakkoli This is just a wrapper around the SQLCipher native libraries. You can research about SQLCipher online to see if it is appropriate for your use case. |
Thanks for your response and great library. |
@MojtabaTavakkoli If you are looking for examples on how to use the library I'd recommend checking out the sqflite docs which show how to insert and query a database. There are also a couple of resources with more complex scenarios. All of that applies to this package. Encryption is just an extra. |
Thanks. |
@MojtabaTavakkoli Alright, I see what you mean. I personally have the same use case as you. What I do is I create a preloaded database from my development environment (Linux), I encrypt it with a script using the SqlCipher binaries from the platform and then I copy it to the Flutter assets folder. Then, from the app, you would have to copy the asset database to the device itself before opening it. The example project in this plugin has an example where a database is copied from assets if you want to look at that. |
Hola! |
Hello. |
just one question, i can't open my database on my pc (ubuntu). i had try with db browser without success. j'ai besoin de connaître les parametres d'encryption par defaut . do you have any information? |
@MojtabaTavakkoli Thanks! Happy you got it working. @Thetyne I'm using SqliteBrowser on Linux, but in order to have SqlCipher support you need to compile it yourself. That is what I did and it works like a charm. You get an option to provide a password when opening. |
yea its pretty simple and awesome. I came up to it in last searches but yet it was very handy so I'm using it from now on. |
@Thetyne Another option that may be simpler is to decrypt the database from command line and open it with regular SqliteBrowser to inspect. #!/bin/bash
if [ -z "$1" ]
then
echo "No argument supplied"
exit
fi
echo "Decrypting $1"
rm decrypted.db
echo "PRAGMA KEY = 'mypassword'; ATTACH DATABASE 'decrypted.db' AS decrypted KEY ''; SELECT sqlcipher_export('decrypted'); DETACH DATABASE decrypted;" | sqlcipher $1
echo "Done." You can change the password in the script and run it like |
hi @davidmartos96 i cant open my db in native side.. and this is my code to opendb
it say "File is not database".. what's wrong with mine? |
@fauzy6493 At first glance it looks like it's ok. It's basically how the database is opened in the plugin implementation. Are you able to open it from Flutter? Make sure the following is correct:
You could also create a small repo reproducing that behavior so that I can take a look at it, but it should work. |
and it work for crud operation in flutter. but if i open in native side.. it say "file is not database" |
how can i open it using terminal? i try this step for check in terminal:
|
You can test it on a desktop terminal using
Since the database is created on Flutter, you could create a small demo project so that I can test it out. |
hi @davidmartos96 my problem is solved, i forgot to change : |
@fauzy6493 Why do you need |
omg, i guess i still need that dependency.. Thank you.! |
ok thank you, it work! |
Hello, |
Yes, you can set a password with the help of Sqlcipher. To do it you need to install SQLCipher v4.x on your development machine. Encrypt it using the CLI and then use that db in the Flutter app. |
Support latest sqlite3 package
Clearly this is not an 'issue'. I too needed to include an encrypted db inside my Flutter app. The originator of the data (within the pre-loaded database) did not want users 'copying and emailing' the db file to other non-paying users. Encryption is the way to go then. I downloaded DB Browser for SQLite... created a test database, loaded it with some data (4,000 rows in a single table for an example), encrypted it, and copied it into my Flutter assets. Then I referenced the plug-in on David's site, followed some example code on the 'net, and boom, it works like a charm. 4,000 rows are almost instantly loaded into a true object list.
Great work David! Do you think you will 'finalize' this project and host it at pub.dartlang.org?
Thanks again,
-David
Centennial, CO USA
The text was updated successfully, but these errors were encountered: