LAMW: Encrypt sqlite DB lazarus / 43-Android ---------------------------------------------------------------------- c4p · 2024-08-07 22:26 Is there a way to encrypt the jSqliteDataAccess database using LAMW? Thanks in advance. ---------------------------------------------------------------------- Guser979 · 2024-08-08 01:08 Not at the moment. But you can ask chatgpt and he will guide you: "I have a code that uses SQLiteDatabase from Android SDK, but I want to adapt this code and include encryption in my database. Give me an example" PS. you wrote: "Don't use jPanel in your LAMW app..." Are you sure the problem is jpanel? Is your LAMW up to date? I just migrated a project to use RecyclerView, Jlist, ScroolView and also used several Jpanel(respecting limits). Everything worked perfectly. Maybe it's some other detail causing the errors. ---------------------------------------------------------------------- c4p · 2024-08-08 07:02 Thanks, I have implemented dcpcrypt for an update file, but need the db encrypted now, I can try something with dcpcrypt I guess. Not had much luck with chatgpt et al. most of the time it's wrong and you have to keep challenging it, had more luck on stackoverflow tbh. Re jPanel, pretty sure, I've eliminated jPanel completely from my app now due to the sluggish performance I experienced, I even rebuilt the app from scratch at one point before realising, my LAMW is up to date, jPanel slows down the app considerably, although I need to do further testing what the tipping point is, but the performance hit disappeared when I got rid of jPanel in my app, a night and day performance difference, but, you might get away with one or two, but I got rid of them all, has caused me a headache for a while, rotate took a long time as did general speed of the app, I think it may be redraw issue, not really sure why though, I just avoid using it now. I'm not having a go at the developers re jPanel btw, everyone involved in LAMW have done a tremendous job with LAMW, something I use every day now! I think someone else needs to test jPanel to see what's going on as it really does impact the performance. ---------------------------------------------------------------------- Zvoni · 2024-08-08 07:41 Quote from: c4p on August 08, 2024, 09:02:19 amThanks, I have implemented dcpcrypt for an update file, but need the db encrypted now, I can try something with dcpcrypt I guess. Beware: Do you want to encrypt the CONTENTS of the SQLite-Database, or the SQLite-Database itself? dcpcrypt is for encrypting the CONTENT See here for encrypting the DB itself: https://github.com/sqlcipher ---------------------------------------------------------------------- Guser979 · 2024-08-08 10:53 Yes. Jpanel does have limits and can affect performance. In the project I mentioned, I didn't have any problems, even without having "cleaned" it. There are certainly redundancies, etc. I tested it thoroughly. Attached printscreen. It may also depend on the type of app and the response required during execution. Yes. Chatgpt offers many approaches to what is asked. But over time I learned to "filter" his responses in order to make him focus on what I need. In fact sqlcipher was chatgpt's proposal. I even tested including the dependency in build.gradlle. I imported what was necessary into the LAMW sqllitedataaccess.java code and compiled it.  From this point on, you need to migrate the code to use sqlcipher. Chatgpt offered an example but I didn't go further due to lack of time. ---------------------------------------------------------------------- c4p · 2024-08-08 13:01 Sqlcipher looks like what I'm after. Thanks @Zvoni @Guser979 Quote from: Zvoni on August 08, 2024, 09:41:32 amQuote from: c4p on August 08, 2024, 09:02:19 amThanks, I have implemented dcpcrypt for an update file, but need the db encrypted now, I can try something with dcpcrypt I guess. Beware: Do you want to encrypt the CONTENTS of the SQLite-Database, or the SQLite-Database itself? dcpcrypt is for encrypting the CONTENT See here for encrypting the DB itself: https://github.com/sqlcipher