Knowledge Base

Search Knowledge Base

KB #240024: Tip for improving performance of column encryption APIs

Type: Tip
Summary:
Column encryption APIs will work significantly faster if you do not initialize and free a key around each encrypt/decrypt.
Additional Information:
Note: If you are using Encryptionizer for SQL Column Encryption where you have created Transparent views, this article is not applicable as you are not executing key definition on each call. You can improve column encryption performance by using the latest version of Encryptionizer with CLR type SQL API’s.

Many developers use the following technique for encrypting a column of data:

   For each row
Initialize Key (Setkey or Initkey api)
Encrypt or Decrypt column with key handle
Release Key (Clearkey or Freekey api)
Next row

However, initializing the key is the most time consumimg portion of the operation. If you are only encrypting a single row, or if you have a low transaction volume, you may not notice the difference. But with large queries, or high transaction volume, the differece will be significant. The proper technique is:

   Initialize Key (Setkey or Initkey api)
For each row
Encrypt or Decrypt column with key handle
Next row
Release Key (Clearkey or Freekey api)

 

Top