My little corner on the internet

The First Line's Prayer

The ever-repeating prayer of end-user support

April 14, 2022

Encryption Adventures in SQL Server

When calling EncryptByKey() in SQL server you will get a bunch of bytes in return. This article from Microsoft describes the structure of these bytes. If you pay close attention, it is even possible to work with this format outside of SQL server. Both decrypting and encrypting is possible, given that you can get the encryption key available outside of SQL Server. Using a HSM with the EKM integration is one way to do this, as SQL server has no native integration for exporting and importing keys....

April 14, 2022