netpyoung / SqlCipher4Unity3D

💾 SqlCipher made easy for Unity3d
MIT License
163 stars 37 forks source link

File is encripted or is not a database #24

Closed AndradeSoto closed 4 years ago

AndradeSoto commented 4 years ago

Hello

I imported the examples and test SQLitetest scen and works fine, but the SQLCipherTest scene doesn´t work fine

The scene created the database and is correctly encrypted, but when unity try to open I have an error

SqliteException: file is encrypted or is not a database FullQuery=|delete from UserData;|(ErrorCode:26) SqliteDatabase.Prepare (System.String query) (at Assets/Plugins/SqliteDatabase.cs:400) SqliteDatabase.ExecuteNonQuery (System.String query) (at Assets/Plugins/SqliteDatabase.cs:263) SQLSample.Start () (at Assets/Tests/Scripts/SQLSample.cs:30)

I know the database was made correctly because I used DB Browser(SQLCipher) to open the file/database and is opened correctly

Only with unity can't opent the database.

netpyoung commented 4 years ago

Which SqlCipher version had been used?

Current Sqlcipher4Unity3D using v3 encription. I have a plan to support v4 but I don't have mac and test device for ios so It having been delayed.

It seems to using SqiCipher v4.(default for DB Browser). Could you check the encryption settings?

Annotation 2019-11-08 173250

AndradeSoto commented 4 years ago

When I run the SQLCipherTest scene it creates the database, with password 'password', then Unity try to open and write data, but I get this error.

Captura de pantalla (71)

But I can open the database with DB Browser(SQLCipher) select v3

Captura de pantalla (76)

Captura de pantalla (77)

The database is created, but Unity can´t to open it.

netpyoung commented 4 years ago

Um that's interesting. Could you share the db file, password and some snippet code for open that file?

AndradeSoto commented 4 years ago

https://github.com/AndradeSoto/TestEncrypt

I just did a project and imported your example, this is the code, the password to database is "password".

netpyoung commented 4 years ago

Thank you share your project for checking.

I checked your repo then I found that you are using other library. So I can't help to solve that problem.

Could you trying this project's library?

If you have any problems to using this library, feedback to me. I will help you gladly.

netpyoung commented 4 years ago

@AndradeSoto Because, That's not associated with this project, so I close this issue. If any problem of using this library please create another issue for that.