Firebird 3 + IBDAC + Database Encryption

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Fabrice
Posts: 45
Joined: Tue 07 Sep 2010 09:44

Firebird 3 + IBDAC + Database Encryption

Post by Fabrice » Mon 16 Dec 2019 08:47

Hello,

How to handle database encryption with IBDAC like described here :
https://www.ibphoenix.com/files/conf201 ... yption.pdf
https://ib-aid.com/crypt

Connection in a case of encrypted database
●It is necessary to pass the encryption name and key during the regular connection
●Yes, additional network roundtrip(s) is done
●To pass key, it is necessary to implement interface ICryptCallback

Connecting native apps through fbcrypt.dll (Delphi, C++, PHP)
1)fbcrypt_init(pszClientPathName:Pointer) : integer; 2)fbcrypt_key(pszKeyName:Pointer;pKeyValue:Pointer;iKeyLength:Cardinal) : integer; 3)fbcrypt_callback(provider:Pointer) : integer;
●And after that establish connection as usual

Delphi example (w/o error handling)
In BeforeConnect handler
fbcrypt_init(PAnsiChar(‘C:\Firebird30\fbclient.dll’));
fbcrypt_key(‘RED’, ‘0xec,0xa1,0x52,0xf6,...’));
fbcrypt_callback();
Then connect as usualDatabase1.Active:=True;

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Firebird 3 + IBDAC + Database Encryption

Post by ViktorV » Thu 19 Dec 2019 09:03

Database encryption in Firebird 3 is implemented as transparent encryption at the data page level. This is impelemnted by developing special extensions for Firebird, which you should develop by yourself or use the existing ones. Example: https://ib-aid.com/download-demo-firebi ... ion-plugin

Post Reply