Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Sqlite encryption
Sqlite encryption [message #60164] Tue, 19 September 2023 17:37 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I have seen many methods like IsEncrypted(), ChangePassword(), Open(..., cypher)...
so it seems that the db can be encrypted. I need not to let the user to open the db with some external tool like DB for Sqlite Browser and performs unwanted operations.
I would like to have a very short example of:

1. how to create a db in some encrypted way;
2. how to read/write data while it is being used by my U++ client (if the queries need some special flag).

From what I read so far it seems that should be enough to open the database in this way:

if(!sqliteVT.Open( dbname, some_password, Upp::Sqlite3Session::CIPHER_CHAHA2020_DEFAULT )) {
...
}


all the rest remain the same. Can you confirm?

Many thanks in advance.
Luigi

[Updated on: Tue, 19 September 2023 19:38]

Report message to a moderator

Re: Sqlite encryption [message #60168 is a reply to message #60164] Wed, 20 September 2023 17:24 Go to previous messageGo to next message
coolman is currently offline  coolman
Messages: 114
Registered: April 2006
Location: Czech Republic
Experienced Member
Hi Luigi,

Yes, it is enough to open database with password and selected cipher. If you need to change password use this function:

sqlite3db.ChangePassword(password, Upp::Sqlite3Session::CIPHER_CHAHA2020_DEFAULT)


(changing from encrypted to unencrypted is done by entering an empty password)

BR, Radek


Re: Sqlite encryption [message #60169 is a reply to message #60168] Wed, 20 September 2023 18:22 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
coolman wrote on Wed, 20 September 2023 17:24
Hi Luigi,

Yes, it is enough to open database with password and selected cipher. If you need to change password use this function:

sqlite3db.ChangePassword(password, Upp::Sqlite3Session::CIPHER_CHAHA2020_DEFAULT)


(changing from encrypted to unencrypted is done by entering an empty password)

BR, Radek




Hi Radek,

thanks a lot for both answers!
Changing password with a void one did the trick! Very easy... knowing what to do Very Happy

Best regards,
Luigi
Previous Topic: How to make a copy not crypted of a Sqlite db
Next Topic: SqlPerformScript bug: Not doing anything if script starts with "BEGIN;" and ends with "END;"
Goto Forum:
  


Current Time: Mon Apr 29 08:12:24 CEST 2024

Total time taken to generate the page: 0.02937 seconds