The table in the database (sqlite3) will look something like this:

id | date | text 1 | 1.1.1970 | Blablabla 

I want to add the ability to encrypt data in the database with a password from the user.

Problems:

  1. If you encrypt the date , you can not sort the records by date created.
  2. If you encrypt the text , there will be problems with the search.

How to encrypt records in the database?

UPD

One more question. Suppose the user has forgotten the password that is encrypted data. How to correctly implement password recovery?

Just send a new one to the mail, because It is not suitable for decoding.

  • one
    What is the purpose of encryption? Google on request "sqllite encryption" offers various options. And it is clear that they all relate to encryption on the disk. with sql queries, if the database was successfully opened, then it is seen in its usual form. - Mike
  • @Mike, thank you, did not know about it. One more question. Suppose the user has forgotten the password that is encrypted data. How to correctly implement password recovery? - pank
  • 2
    I'm afraid this is not possible with normal encryption. If you don’t save the encrypted password separately somewhere :) Well, or you won’t store user passwords on your secure server and how to authorize users - Mike

0