Encriptar archivos DBF

133 views
Skip to first unread message

Clip Fox

unread,
Dec 10, 2025, 7:46:49 PM (6 days ago) Dec 10
to Harbour Users
Hola amigos, quiero encriptar los archivos DBF como puedo hacer esto, harbour 3.2 tendrá alguna función para hacer esto.

Gracias por la ayuda que me puedan dar...

marcos...@gmail.com

unread,
Dec 10, 2025, 11:42:40 PM (6 days ago) Dec 10
to Harbour Users
Hola

Los RDD  (Replaceable Database Drivers)  que manejan las tablas en Harbour no tienen la opción de encriptarlas.

El único RDD que tiene esa opción es ADS  (Advantage Database Server) , pero este ya no tiene soporte por la empresa, descontinuo el producto.

Si se desea encriptar los datos hay que encriptar y desencriptar cada registro que se graba o se lee en las tablas, para esto se puede emplear la función Crypt.

SYNTAX
CRYPT(<cString>,<cKeystring>) --> cString
ARGUMENTS
<cString> Designates the string that is that is encrypted.
<cKeystring> Designates the password with which the string is encrypted.
RETURNS
CRYPT() returns the encrypted string.

Ejemplo:

PROCEDURE main()
    LOCAL cVar
    cVar:= CRYPT("HARBOUR", "Ca12567Vm")
    ? cVar
    ? CRYPT(cVar, "Ca12567Vm") // HARBOUR
RETURN

Información de Advantage Data Server 12

Encryption
Advantage provides the capability to encrypt tables and associated data. Data encryption is just one part of the process of creating a secure system. The following are some of the steps that can be taken to secure a database:
· Restrict physical access: Prevent direct user access by keeping all data on a physically remote server and using Advantage Database Server to access the data.
· Use access controls: Use a data dictionary with user logins to restrict who can connect to the database.
· Permissions: Use database roles and assign user and group permissions to fine-tune levels of access that users can have.  
· Require logins: Disable free connections on the Advantage Database Server to force all connections to authenticate through a data dictionary.
· Encrypt communications: Enable the encryption of communications between the client and server application with Transport Layer Security (TLS) available beginning in v10.1 or with the existing encryption available with both UDP and TCP/IP communications.
· If requirements call for it, enable FIPS mode to ensure that only encryption algorithms approved for the Federal Information Processing Standard (FIPS) 140-2 are used.
· Encrypt data: Enable table encryption at the data dictionary level or in individual free tables.
The current topic discusses data encryption. It can be used with both free tables and data dictionary tables and with Advantage Local Server and Advantage Database Server. The general scheme is the same for all cases: Advantage uses a password to seed an encryption stream that is used to encrypt the data (plain text) into "unreadable" cipher text using a symmetric encryption algorithm.

Saludos

Marcos Jarrin


Hello,

The RDDs (Replaceable Database Drivers) that handle tables in Harbour do not have the option to encrypt them.

The only RDD that has that capability is ADS (Advantage Database Server), but it no longer has support from the company, as the product has been discontinued.

If you wish to encrypt data, you must encrypt and decrypt each record that is written to or read from the tables. For this, you can use the Crypt function.

SYNTAX  
CRYPT(<cString>,<cKeystring>) --> cString  
ARGUMENTS  
<cString> Designates the string that is to be encrypted.  
<cKeystring> Designates the password used to encrypt the string.  
RETURNS  
CRYPT() returns the encrypted string.

Example:

PROCEDURE main()
    LOCAL cVar
    cVar:= CRYPT("HARBOUR", "Ca12567Vm")
    ? cVar
    ? CRYPT(cVar, "Ca12567Vm") // HARBOUR
RETURN

Information about Advantage Data Server 12

Encryption  
Advantage provides the capability to encrypt tables and associated data. Data encryption is just one part of the process of creating a secure system. The following are some of the steps that can be taken to secure a database:  
· Restrict physical access: Prevent direct user access by keeping all data on a physically remote server and using Advantage Database Server to access the data.  
· Use access controls: Use a data dictionary with user logins to restrict who can connect to the database.  
· Permissions: Use database roles and assign user and group permissions to fine-tune levels of access that users can have.  
· Require logins: Disable free connections on the Advantage Database Server to force all connections to authenticate through a data dictionary.  
· Encrypt communications: Enable the encryption of communications between the client and server application with Transport Layer Security (TLS) available beginning in v10.1 or with the existing encryption available with both UDP and TCP/IP communications.  
· If requirements call for it, enable FIPS mode to ensure that only encryption algorithms approved for the Federal Information Processing Standard (FIPS) 140-2 are used.  
· Encrypt data: Enable table encryption at the data dictionary level or in individual free tables.  
The current topic discusses data encryption. It can be used with both free tables and data dictionary tables and with Advantage Local Server and Advantage Database Server. The general scheme is the same for all cases: Advantage uses a password to seed an encryption stream that is used to encrypt the data (plain text) into "unreadable" cipher text using a symmetric encryption algorithm.

Best regards,

Marcos Jarrin

hmpaquito

unread,
Dec 11, 2025, 3:21:03 AM (6 days ago) Dec 11
to Harbour Users
Buenos días,

DBFCDX y otros drivers sí permiten la encriptación pero quedan al descubierto los campos memo y los indices

Para encriptar registros con el driver DBFCDX, el proceso es el mismo que con el driver DBF estándar, ya que DBFCDX hereda toda la funcionalidad de encriptación del RDD base DBF. hbrddcdx.h:451-470


Resumen

El driver DBFCDX soporta encriptación de registros a través de la estructura DBFAREA que contiene como miembro. No hay funciones especiales de encriptación para CDX; utiliza las mismas funciones del RDD DBF. dbfcdx1.c:1-50

Funciones de encriptación (heredadas de DBF)Configurar contraseñastatic HB_BOOL hb_dbfPasswordSet( DBFAREAP pArea, PHB_ITEM pPasswd, HB_BOOL fRaw )

dbf1.c:731-794

Encriptar/Desencriptar tablastatic void hb_dbfTableCrypt( DBFAREAP pArea, PHB_ITEM pPasswd, HB_BOOL fEncrypt )

dbf1.c:799-868

Lectura de registros encriptadosstatic HB_ERRCODE hb_dbfGetRec( DBFAREAP pArea, HB_BYTE ** pBuffer )

dbf1.c:2090-2121

Constantes de control

Usa estas constantes con dbInfo()dbinfo.ch:281-291

  • DBI_ISENCRYPTED (132) - Verificar si la tabla está encriptada
  • DBI_ENCRYPT (140) - Encriptar la tabla
  • DBI_DECRYPT (141) - Desencriptar la tabla
Estructura

La estructura CDXAREA contiene una DBFAREA como primer miembro, heredando todos los campos de encriptación: hbrdddbf.h:208-242

  • bCryptType - Tipo de encriptación (DB_CRYPT_SIX)
  • pCryptKey - Puntero a la clave de encriptación
  • fEncrypted - Indica si el registro actual está encriptado
  • fTableEncrypted - Indica si toda la tabla está encriptada
Método de encriptación

DBFCDX usa el método de encriptación SIX (DB_CRYPT_SIXdbinfo.ch:372-374 , igual que el driver DBF estándar.

Notas
  • La encriptación funciona igual que con DBF estándar
  • Los índices CDX no se encriptan, solo los datos de la tabla
  • La tabla debe estar abierta en modo exclusivo para encriptar/desencriptar
  • Los registros encriptados se marcan con 'D' o 'E' en el primer byte


Saludos

Clip Fox

unread,
Dec 11, 2025, 8:37:52 PM (5 days ago) Dec 11
to harbou...@googlegroups.com
Hermano muchas gracias dejame ver bien la informacion que me enviastes Dios te bendiga...

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/FkaJnVhhBKA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/a9449808-8baf-444d-83b2-7194d5bfab1dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages