This topic is locked

How to decrypt record from Mysql query in PHPR Project?

4/6/2014 7:03:14 AM
PHPRunner General questions
A
Abul author

I am using PHPR Enterprise 7.0 ver. I have a table in MySQL db where most of the fields are encrypted by adopting code-based encryption method in PHPR project. It works fine to retrieve encrypted data when I call those fields from any of the pages created by PHPR. But it has problem for me when I try to call those fields from any custom pages. Such as I have created a custom report page by using FPDF lib where I have to do Mysql_query for those encrypted fields. I used typical PHPR decryption syntax like

cast(DES_DECRYPT(unhex(encrypted field), 'encryption key') as char);


but unfortunately this is not working. However if I use database encryption method in PHPR project then this syntax works fine.
Could any one please help me out how can I perform Mysql_query on custom page (i.g., FPDF page) for code-based encrypted fields in PHPR? I appreciate your kind help. Thanks.

Sergey Kornilov admin 4/7/2014

You cannot use SQL query to decrypt data that were encrypted with code-based method. Data encrypted with code-based can be only descrypted using code-based method meaning you won't be able to pass this data to third party applications.