Sqlite encrypted database

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
Steed
Posts: 386
Joined: Sat Dec 12, 2009 3:40 pm
Has thanked: 2 times
Been thanked: 2 times

Re: Sqlite encrypted database

Post by Steed » Sun May 07, 2017 5:49 pm

Thnaks

User avatar
mustafa
Posts: 860
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 132 times
Contact:

Post by mustafa » Sun May 12, 2019 10:09 am

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 77 times
screenshot.jpg
screenshot.jpg (144.02 KiB) Viewed 1602 times

User avatar
mustafa
Posts: 860
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 132 times
Contact:

Post by mustafa » Tue May 28, 2019 10:36 am

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 74 times
screenshot3.jpg
screenshot3.jpg (162.89 KiB) Viewed 1520 times

User avatar
mustafa
Posts: 860
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 132 times
Contact:

Post by mustafa » Tue May 28, 2019 11:03 am

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: 386
Joined: Sat Dec 12, 2009 3:40 pm
Has thanked: 2 times
Been thanked: 2 times

Post by Steed » Tue May 28, 2019 2:40 pm

Thanks

User avatar
serge_girard
Posts: 2370
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 628 times
Been thanked: 126 times
Contact:

Post by serge_girard » Tue May 28, 2019 2:52 pm

Thanks Mustafa!

Serge

User avatar
jairpinho
Posts: 346
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Has thanked: 3 times
Been thanked: 11 times
Contact:

Post by jairpinho » Tue May 28, 2019 5:30 pm

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: 860
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 132 times
Contact:

Post by mustafa » Wed May 29, 2019 11:11 am

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 1456 times

User avatar
mustafa
Posts: 860
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 132 times
Contact:

Post by mustafa » Tue Nov 05, 2019 12:20 pm

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 43 times

franco
Posts: 367
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Been thanked: 11 times

Post by franco » Tue Nov 05, 2019 4:51 pm

Thanks for sharing Mustafa!
Franco
Franco Bushie
Canada

Post Reply