Sqlite encrypted database

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
Steed
Posts: 427
Joined: Sat Dec 12, 2009 3:40 pm

Re: Sqlite encrypted database

Post by Steed »

Thnaks
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Sqlite encrypted database

Post 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
Attachments
Sqlite_Photo_Selection.zip
(625.61 KiB) Downloaded 470 times
screenshot.jpg
screenshot.jpg (144.02 KiB) Viewed 7737 times
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Sqlite encrypted database

Post 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
Attachments
Sqlite_Photo_Selection_New.zip
(714.81 KiB) Downloaded 466 times
screenshot3.jpg
screenshot3.jpg (162.89 KiB) Viewed 7655 times
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Sqlite encrypted database

Post 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
User avatar
Steed
Posts: 427
Joined: Sat Dec 12, 2009 3:40 pm

Re: Sqlite encrypted database

Post by Steed »

Thanks
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Sqlite encrypted database

Post by serge_girard »

Thanks Mustafa!

Serge
There's nothing you can do that can't be done...
User avatar
jairpinho
Posts: 420
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Contact:

Re: Sqlite encrypted database

Post 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
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Sqlite encrypted database

Post 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
Attachments
screenshot4.jpg
screenshot4.jpg (65.73 KiB) Viewed 7591 times
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Sqlite encrypted database

Post by mustafa »

Translated from Spanish by Google

* ---------------------------------- *
 SQLite Photo Base New_Plus
* --------------------------------- *
Hello friends:
I leave a new delivery
Experimenting with Database Sqlite

News:

Continuing with the experimentation I have increased
the new task permit system where
Each user depends on their category, has more
permissions or less.

In the Menu Hours of User Entry and Exit
We have some New Buttons that facilitate the
different ways that the DataBase can be treated

1.-Vacuum button ("the Vacuum Cleaner")
   We Totally Delete the Database

2.-Delete Record button
   We will delete the Registry that we are positioned
   within the DataBase

3.-Delete by Name button
   We will delete all records of the same Name

4.-Delete by Date button
   We will delete all records below the
   System date.
   a.- If we place Name it will delete records by
   lower date and matching by Name
   b.- If we do not place Name it will erase all
   records lower than System Date.

5.-Print button
   The novelty in the Listings is the incorporation
   of the Total Sum of Hours between Entry and Exit
   of the User
   Listings: By User or by Total Users

I hope you may be interested

* ------------------------ Important ------------------------ *
At the start of the program, the "System Access" window appears.
View Folder Screenshot or file Help_Key.txt

Username: George
Charge: General Manager
Password: admin

* ------------------------------------------------- ------------ *

Regards
Mustafa
Attachments
Sqlite_Photo_Selection_New_Plus.zip
(1.44 MiB) Downloaded 466 times
franco
Posts: 816
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Sqlite encrypted database

Post by franco »

Thanks for sharing Mustafa!
Franco
All The Best,
Franco
Canada
Post Reply