| Start | ||||
|---|---|---|---|---|
Encryption by certificate Create the certificate Usually, you would encrypt with a symmetric key, that key would get encrypted by the asymmetric key (public key) from your certificate. Also, note that encryption is limited to certain lengths depending on key length and returns NULL otherwise. Microsoft writes: "The limits are: a 512 bit RSA key can encrypt up to 53 bytes, a 1024 bit key can encrypt up to 117 bytes, and a 2048 bit key can encrypt up to 245 bytes." EncryptByAsymKey has the same limits. For UNICODE this would be divided by 2 (16 bits per character), so 58 characters for a 1024 bit key. |
||||
Encryption of database This uses 'Transparent Data Encryption' (TDE) |
||||
Encryption by symmetric key |
||||
Encryption by passphrase This will also encrypt but then by passphrase instead of asymmetric(certificate) key or by an explicit symmetric key. Parameters
RemarksCreation of a DER certificate will work fine. When a Base64 certificate is used however, SQL server will complain with the cryptic message: Import your Base64 certificate to your OS's certificate store to be able to re-export it into DER binary format. Another important thing to do is having an Encryption Hierarchy so that one protects the other, all the way to OS level. See the article on 'Encryption of database/TDE' For more information for creation of certificates go to: https://msdn.microsoft.com/en-us/library/ms187798.aspx (opens new window) For more information for encryption of database/TDE go to: https://msdn.microsoft.com/en-us/library/bb934049.aspx (opens new window) For more information for encryption of data go to: https://msdn.microsoft.com/en-us/library/ms188061.aspx (opens new window) |
Read Article
https://develop.horje.com/learn/1434/reference