1. Jeyakumar Chinnapillai
  2. PowerBuilder
  3. Friday, 28 December 2018 08:58 AM UTC

I am Encrypting the existing PHI data using SQL Server Symmetric Key and later I want to Decrypt the data in PowerBuilder using SymmetricDecrypt function.  Is this Possible in PowerBuilder 2017 R3?

Jeyakumar Chinnapillai Accepted Answer Pending Moderation
  1. Monday, 31 December 2018 06:05 AM UTC
  2. PowerBuilder
  3. # 1

Thanks! I am looking for a solution for data at rest and transit.


I Know, SQL Server 2016 Always Encrypted is one of the solution for this problem, however moving our customer from SQL Server 2012/2014 to 2016 will take couple of years. Hence looking for some other solution.

Regards,

Jey

Comment
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Saturday, 29 December 2018 08:52 AM UTC
  2. PowerBuilder
  3. # 2

Hi Jeyakumar,

 

PB supports calling SQL Server’s Symmetric key for encryption and decryption. However, when you do the Open Symmetric Key, you need to use PB Dynamic SQL. Here is an example:

 

String ls_decryption_begin_sql,  ls_decryption_end_sql

 

ls_decryption_begin_sql = "OPEN SYMMETRIC KEY sym_Demo DECRYPTION BY PASSWORD = 'AppeonPassword123'"

ls_decryption_end_sql = "CLOSE SYMMETRIC KEY sym_Demo"

 

// open symmetric decryption

EXECUTE IMMEDIATE :ls_decryption_begin_sql ;

 

//retrieve data by DW or SQL using EncryptByKey or DecryptByKey function

….

 

// close symmetric decryption

EXECUTE IMMEDIATE :ls_decryption_end_sql ;

 

Regards,
Ken

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 28 December 2018 16:50 PM UTC
  2. PowerBuilder
  3. # 3

Hi Jeyakumar;

  AFAIK  - the SS function that creates the key in SS cannot be retrieved. It can only be used internally within the SS realm ( I could be wrong on that interpretation). However if I am correct without the encryption key, you could not decrypt the data in PB (or any other language for that matter).

Regards ... Chris

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 28 December 2018 14:06 PM UTC
  2. PowerBuilder
  3. # 4

If you are using encryption in the database, it should decrypt and encrypt the data automatically.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.