Page 1 of 3

Encriptación DBF

Posted: Thu Oct 15, 2009 7:38 am
by arroya2
Saludos a Todos.

Me gustaría saber como encriptar y desencriptar una DBF y realizar su mantenimiento de forma transparente.

Muchas Gracias
Rafael Pérez

Re: Encriptación DBF

Posted: Thu Oct 15, 2009 9:08 am
by sudip
Hello,

Please check following commands:

Code: Select all

      ENCODE [ FROM < file > ] ON < key >
            FIELDS <fields,...>
            [ PASSWORD <password> ]
            [ FOR <ForExpression> ]
            [ WHILE <WhileExpression> ]
            [ ALL ]

      ENCODE <file1> TO <file2> [ PASSWORD <password> ] [ DELETE ] 

      ENCODE FILE <file> [ PASSWORD <password> ]
 
and

Code: Select all

      DECODE [FROM <(file)>] ON <key>
            FIELDS <fields,...>
            [ PASSWORD <password> ]
            [ FOR <for> ]
            [ WHILE <while> ]
            [ ALL ]

      DECODE <file1> TO <file2> [ PASSWORD <password>] [DELETE]

      DECODE FILE <file> [ PASSWORD <password> ]
 
With best regards.
Sudip

Re: Encriptación DBF

Posted: Thu Oct 15, 2009 11:06 am
by arroya2
Gracias Sudip.

Lo que yo pretendo es trabajar con una base de datos encriptada y que me aparezcan los datos en pantalla desencriptados y que cuando yo cree un nuevo registro o modifique alguno existente, el usuario vea los datos desencriptados y el programa los almacene encriptados.

Lo que quiero decir es que el programa trabaje con la base de datos encriptada pero ofrezca los datos en pantalla desencriptados. Los indices se deben crear y mantener como si la base de datos estuviese desencriptada.

Saludos
Rafael Pérez

Re: Encriptación DBF

Posted: Thu Oct 15, 2009 11:47 am
by sudip
Hola Fafael,

Comandos de esperanza que funcione para usted. Busqué algunas muestras. Pero no pude encontrar uno.

Si tienes cualquier problema, por favor dígame. Voy a crear un ejemplo para usted. :)

Una cosa más, para entorno multi-usuario, puede que tenga que cuidar para algunas cuestiones. ;)

Lo siento por mi mal español.

Con mis mejores deseos.

Sudip

Re: Encriptación DBF

Posted: Thu Oct 15, 2009 3:27 pm
by Vanguarda
hi friends,

Rafael Pérez, you can use (too) the "Crypto Library for MiniGUI" created for Grigory Filatov.

See the source in "c:\hmg\SOURCE\CRYPT"
In file h_crypt.prg you will find the functions that have on this lib.

I hope help you.

with best regards,

Re: Encriptación DBF

Posted: Fri Jul 02, 2010 6:22 pm
by mustafa
Hola arroya2
Aqui te dejo un ejemplo como encriptar y desencriptar un fichero Dbf
He probado distintos encriptados y este veo que es muy interesante
puesto que se pueden encriptar , todos los campos: Númerico, Caracter,
Fecha, Logico y Memo , otros encriptadores no aceptan todos los
campos.
*-----------------------------------------------------*
Para encriptar la sentencia es:
AcripA:= (Form_1.Texto_01a.value)
criptA := Cript ( AcripA , CHR(077)+CHR(085)+CHR(083)+CHR(084)+CHR(065) ) //<---- "MUSTA")
tambien puede ser asi:
criptA := Cript ( AcripA , "MUSTA") // Clave <---- "MUSTA")

Para desencriptar la sentencia es:
DeCript ( CODE , CHR(077)+CHR(085)+CHR(083)+CHR(084)+CHR(065) ) / // Clave <---- "MUSTA")
tambien puede ser asi:
DeCript ( CODE , "MUSTA" ) // Clave <---- "MUSTA")
*--------------------------------------*
Solo encuentro un Error que no se como subsanar, una vez la base de datos Dbf
Desencriptada, en en campo Caracter, aparte de la letras que se han introducido cuando
se creó el registro se agregan códigos ASCII que no he podido eliminar incluso añadiendo
REPLICATE(CHR(176),25) , no hace ningun efecto.

Si alguien puede revisar dicha anomalia seria interesante.
Un Saludo
*--------------- Google --------------------------*
Hello arroya2
Here I leave an example as encrypt and decrypt a file Dbf
I tried different encrypted and this is very interesting to see that
since it can encrypt all fields: number, Character,
Date, Logico and Memo, other encryption can not accept all
fields.
*------------------------------------------------- ----*
To encrypt the statement is:
AcripA: = (Form_1.Texto_01a.value)
crypt = crypt (AcripA, CHR (077) + CHR (085) + CHR (083) + CHR (084) + CHR (065)) // Key <---- "MUSTA")
can also be like this:
crypt = crypt (AcripA, "MUSTA") // Key <---- "MUSTA")

To decrypt the statement is:
Decrypts (CODE, CHR (077) + CHR (085) + CHR (083) + CHR (084) + CHR (065)) // Key <---- "MUSTA")

can also be like this:
Decrypts (CODE, "MUSTA") // Key <---- "MUSTA")
*--------------------------------------*
Just find a mistake, not as a remedy, once the database Dbf
Decrypted in Character field apart from the lyrics that have been introduced when
the record was created ASCII codes are added I could not remove even adding
REPLICATE (CHR (176), 25), does not make any effect.

If anyone can review that would be interesting anomaly.

Greeting
Mustafa

Re: Encriptación DBF

Posted: Fri Jul 02, 2010 8:04 pm
by gvaronas
Hola Rafael, puedes investigar con DBINFO, yo hago esto:

* Pongo PSW y cierra tabla encriptada
User->(DBINFO( DBI_ENCRYPT,"psw"))
User->(DBCLOSEAREA())
/*
? "Imprime Datos sin encriptar:", User->Usr_Nomb, User->Usr_Pass
* Abrio Tabla, ahora la encripta
? "pONGO psw:", User->(DBINFO( DBI_ENCRYPT,"diegogabriel"))
*User->(dbinfo( DBI_ENCRYPT,"barneyrubble" ) )
? User->(DBINFO(DBI_ISENCRYPTED))
* Agrega Usuario admin
User->(DBAPPEND())
User->Usr_Nomb := "admin1"
User->Usr_Pass := "xxxx"
? "Imprime Datos despues de encriptar:", User->Usr_Nomb, User->Usr_Pass
User->(DBCLOSEAREA())
* Pongo PSW para abrir tabla
User->(DBINFO( DBI_PASSWORD,"psw"))

Espero te sirva.

Salu2,
GVS

Re: Encriptación DBF

Posted: Sat Jul 03, 2010 8:20 am
by mustafa
Password inicio
Aqui te dejo con el mismo sistema de Encriptado
la Clave inicial es : admin
admin
es igual que sea en Mayuscula o Minuscula
para empezar solo poner admin admin luego
con Newclave hacer la nueva clave si
se olvida la nueva clave si borraras
control.mem se volverá a generar automatica
la nueva Clave admin admin procedemos
hacer el cambio de clave y se volverá a
grabar el fichero control.mem

AlControl.mem es el contador de los
intentos que se permiten para entrar
el Password Correcto.

*--------------- Google -----------------------*
Startup Password
Here I leave with the same encryption system

The initial key is: admin
admin
As it is case sensitive
to start then just put admin admin
Newclave do with password if
forget the new password if you delete
control.mem automatically rebuilds the
the new admin password admin proceed
to change key and re-
save the file control.mem

AlControl.mem is the meter of the
attempts that are allowed to enter
the Password Correct.

Greeting
Mustafa

Re: Encriptación DBF

Posted: Sun Feb 16, 2014 12:02 pm
by mustafa
Hola amigos

Hay un antiguo Post:
http://hmgforum.com/viewtopic.php?f=5&t ... tar#p11890" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
que "arroya" preguntaba ,Trabajar con una Base de Datos Encriptada.

En su momento conteste con una solucion que la base de Encriptacion la desarrollo
el "Guille" http://www.elguille.info/clipper/Guru.htm" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;

He intentado ampliar la solucion a la Encriptacion, aportando un Password Variable
que se puede ir cambiando a gusto del usuario autorizado.

Hay un truco para el programador de la aplicacion , si el cliente se olvida de la
clave de acceso el programador solo tiene que borrar el fichero "xControl.mem" y
se generara un nuevo Password , con "admin"- "admin".

Tanto al Comienzo como al Final solo quedara el Fichero Encriptado "TEST.DBF"
Espero que les guste.

Username ---------> admin
Password ----------> admin


Saludos
Mustafa

*-------------------------------- Google------------------------------------*

Hello friends

There is an old Post:
http://hmgforum.com/viewtopic.php?f=5&t ... =encriptar" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false; # p11890
that "arroya" wondered , Working with an encrypted database.

At the time they reply with a solution based on the development Encryption
the "Guille" , http://www.elguille.info/clipper/Guru.htm" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;

I tried to extend the solution to the Encryption, providing a Variable Password you
can be changing to suit the authorized user.

There is a trick to the developer of the application, if the client forgets the Password
the developer simply delete the file "xControl.mem" and generate a new Pasword
with "admin" - "admin".

Both the Beginning and the End just stay the File Encryption "TEST.DBF"
Hope you like.

Username ---------> admin
Password ----------> admin

Regards
Mustafa

Re: Encriptación DBF

Posted: Sun Feb 16, 2014 8:36 pm
by danielmaximiliano
My buen trabajo Mustafa ... gracias por compartir