Page 2 of 2

Re: Sqlite encrypted database

Posted: Sun May 07, 2017 5:49 pm
by Steed
Thnaks

Re: Sqlite encrypted database

Posted: Sun May 12, 2019 10:09 am
by mustafa
Hola amigos
Veo que el tema SQLite está interesando mucho en este foro
Permitir que aporte este sample basado en antiguas aplicaciones
que he unificado en una Nueva
viewtopic.php?f=9&t=4787&p=45649&hilit=mustafa#p45649
Password_Restricted_Access_Sqlite.zip
viewtopic.php?f=9&t=4795&p=45549&hilit= ... ite#p45549
Sqlite_Sample.zip
*-----------------------------------------------------------------*
Al inicio programa sale ventana "System Access"
"Username:" "ADMIN"
"Charge:" "General Manage"
"Password" "ADMIN"
*-----------------------------------------------------------------*
En ventana inicial "System Access" nos otorga
los permisos para poder operar en el programa
según el usuario que indiquemos.
Mirar ---> File Readme_Ya.txt

Espero que les pueda gustar
Un saludo
Mustafa
*------------------------------------- Google ---------------------------------*
Hello friends
I see that the SQLite theme is very interesting in this forum
Allow me to contribute this sample based on old applications
that I unified in a New
viewtopic.php?f=9&t=4787&p=45649&hilit=mustafa#p45649
Password_Restricted_Access_Sqlite.zip
viewtopic.php?f=9&t=4795&p=45549&hilit= ... ite#p45549
Sqlite_Sample.zip
* ----------------------------------------------------------------- *
The "System Access" window appears at the start of the program
"Username:" "ADMIN"
"Charge:" "General Manage"
"Password" "ADMIN"
*------------------------------------------------------------------*
In the initial window "System Access" grants us
the permits to operate in the program
according to the user that we indicate.
Look ---> File Readme_Ya.txt

I hope you like it
a greeting
Mustafa

Re: Sqlite encrypted database

Posted: Tue May 28, 2019 10:36 am
by mustafa
Hola amigos:
Les dejo una nueva entrega
Experimentando con Database SQLite

Novedades:

Siguiendo con la experimentación he incrementado
el nuevo sistema de permisos de tareas, donde
cada usuario depende de su categoría, tiene más
permisos o menos.
Mediante la adecuación de BOOLEAN = LOGICO
SQLite en BOOLEAN solo tiene 0 ó 1 se ha conseguido
que en GRID salga .F. ó .T.

Otra de las novedades es el control de entradas y
salidas del usuario mediante Fecha diaria y hora de
entrada y hora de salida, cálculo de Horas Totales

Gracias a la aportación del amigo Dragancesu , del cual
estoy aprendiendo mucho , he utilizado su brillante
trabajo de Listados en Impresora , adecuándolo su
código a mi Sample. Ver
viewtopic.php?f=5&t=5994&hilit=dragancesu&start=30
Espero que pueda interesarles

*------------------------- Importante ------------------------*
Al inicio programa sale ventana "System Access"
Username: george
Charge : General Manager
Password: admin
*---------------------------------------------------------------*

Saludos
Mustafa

*---------------------------------------- Google -----------------------------------------*
Hello friends:
I leave a new delivery
Experimenting with Database SQLite

News:

Continuing with the experimentation I have increased
the new system of work permits, where
Each user depends on their category, has more
Permits or less.
By adapting BOOLEAN = LOGICAL
SQLite in BOOLEAN only has 0 or 1 has been achieved
that in GRID leave .F. or .T.

Another innovation is the control of tickets and
user exits by Daily Date and Time of
entry and time of departure, calculation of Total Hours

Thanks to the contribution of the Dragancesu friend, of which
I'm learning a lot, I've used your brilliant
work of Listings in Printer, adapting its
code to my Sample. View
viewtopic.php?f=5&t=5994&hilit=dragancesu&start=30

I hope you can be interested

*----------------------Important -------------------------------*
The "System Access" window appears at the start of the program
Username: george
Charge : General Manager
Password: admin
*-----------------------------------------------------------------*
Regards
Mustafa

Re: Sqlite encrypted database

Posted: Tue May 28, 2019 11:03 am
by mustafa
Modificación de ultima hora
En el fichero "New_Clavex.prg"
Habria que modificar el siguiente
código en la FUNCTION CleanQ()
*------------------------------ Google ------------------------------------*
Last minute modification
In the file "New_Clavex.prg"
It would have to modify the following
code in the FUNCTION CleanQ()

Code: Select all

*---------------------------------------------------------*
 FUNCTION CleanQ()
*---------------------------------------------------------*
  dbo := connect2db("datetime.db3",.F.)
  dbo := connect2db("control.db3" ,.T.)
 
  Form_1Q.Texto_01Q.value   := " "
  Form_1Q.Texto_03Q.value   := " "
  Form_1Q.Image_1bQ.PICTURE := "Photos\000100.jpg"
  Form_1Q.Label_1bbQ.value  := " "
  Form_1Q.Radio_Set.Value   :=  1
  Form_1Q.Radio_1.PICTURE   :="Resource\Semaphore_1.jpg"
  nLogXQ  = 1
  Form_1Q.Combo_01Q.value   :=  nLogXQ 
  Form_1Q.Edit_1.value      := " "
  Form_1Q.Texto_00Q.Value   := " "
 *------------------------------------------*     
  Form_1Q.Check_01.Value    := .F.
  Form_1Q.Check_02.Value    := .F.
  Form_1Q.Check_03.Value    := .F.
  Form_1Q.Check_04.Value    := .F.
  Form_1Q.Check_05.Value    := .F.

Return  Nil  
Saludos/Regars
Mustafa

Re: Sqlite encrypted database

Posted: Tue May 28, 2019 2:40 pm
by Steed
Thanks

Re: Sqlite encrypted database

Posted: Tue May 28, 2019 2:52 pm
by serge_girard
Thanks Mustafa!

Serge

Re: Sqlite encrypted database

Posted: Tue May 28, 2019 5:30 pm
by jairpinho
Hi mustafa, I use direct encryption inside the users table:
save the password to the table:
HB_Crypt (cSenha, cChave)
read the table password
db_password: = HB_Decrypt (Alltrim (oRow: FieldGet (4)), cChave)
         If db_senha == cSenha
           your code
         endif

Re: Sqlite encrypted database

Posted: Wed May 29, 2019 11:11 am
by mustafa
Hi friend Jair Pinho
Very good idea the solution you bring from Cript

In my Sample, when the program is closed
a Zip copy is made with Password of the Bases
Data in Folder Backup_Files and leave empty
through "VACUUM"
Inside Folder Backup_Files can not be opened
if you do not provide the password.
In my case it's hidden by #pragma TEXTHIDEN(1)
in the source code, where is PUBLIC ---> ckey
Assuming that the end user does not have this Password
and can not read the database.
Regards
Mustafa