It is currently 22 January 2019, 1:03 Advanced search

Always Encrypted - SQL Server

Questions and answers on how to best use Instant Developer

Always Encrypted - SQL Server

Postby john w » 20 December 2018, 16:12

I have Always Encrypted working with another platform. In reading the Italian side of the forum there appears to be a way to have it work Instant Developer. Does anyone have the connection string syntax I should be using? I have tried several variations without success.

Thanks,

John W
Regards

John W
User avatar
john w
 
Posts: 562
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Always Encrypted - SQL Server

Postby john w » 21 December 2018, 16:41

After some trial and error I have InDe apps working with the Always Encrypted feature of SQL Server (2016 and above). It is nice easy way to handle encryption and decryption at the database column level.

You do need to set up Always Encrypted in the database. It is found in Security-> Always Encrypted. You generate a master key and a column encryption key. You then go to the db table/column and select the Encryption menu option (right click). You tells it what key to use, its a drop down.

In about a minute you can encryption setup and even a column or two encrypted.

To use it in the app you have to add the Column Encryption Setting = Enabled property to the connection string. This was where I had some issues. To work around those I created a procedure and add the code the needed to close the connection, set the new default connection string, and the open the connection.

I then set the procedure to run in the application Initialize event.

InDe see the encrypted field as a blob. It is one it does not recognize. So in the database/table/field I changed the type from Blob to Character.

I ran it all works I wanted. It sounds more complicated than it really is.



John W.
Attachments
Ashampoo_Snap_2018.12.21_10h38m53s_001_.png
Ashampoo_Snap_2018.12.21_10h38m53s_001_.png (17.72 KiB) Viewed 83 times
Ashampoo_Snap_2018.12.21_10h38m05s_001_.png
Ashampoo_Snap_2018.12.21_10h38m05s_001_.png (27.85 KiB) Viewed 83 times
Regards

John W
User avatar
john w
 
Posts: 562
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 7 guests