Skip to content

Latest commit

 

History

History
172 lines (150 loc) · 5.2 KB

cryptographic-functions-transact-sql.md

File metadata and controls

172 lines (150 loc) · 5.2 KB
description title ms.custom ms.date ms.prod ms.prod_service ms.reviewer ms.technology ms.topic dev_langs helpviewer_keywords ms.assetid author ms.author
Cryptographic Functions (Transact-SQL)
Cryptographic Functions (Transact-SQL) | Microsoft Docs
07/24/2017
sql
database-engine, sql-database
t-sql
reference
TSQL
functions [SQL Server], cryptographic
crypto functions
cryptography [SQL Server], functions
decryption [SQL Server], functions
security functions
encryption [SQL Server], functions
0be5626b-5a25-4d8c-9f44-7abbfccf816c
VanMSFT
vanto

Cryptographic functions (Transact-SQL)

[!INCLUDE SQL Server SQL Database]

These functions support digital signing, digital signature validation, encryption, and decryption.

Symmetric encryption and decryption

:::row::: :::column::: ENCRYPTBYKEY :::column-end::: :::column::: DECRYPTBYKEY :::column-end::: :::row-end::: :::row::: :::column::: ENCRYPTBYPASSPHRASE :::column-end::: :::column::: DECRYPTBYPASSPHRASE :::column-end::: :::row-end::: :::row::: :::column::: KEY_ID :::column-end::: :::column::: KEY_GUID :::column-end::: :::row-end::: :::row::: :::column::: DECRYPTBYKEYAUTOASYMKEY :::column-end::: :::column::: KEY_NAME :::column-end::: :::row-end::: :::row::: :::column::: SYMKEYPROPERTY :::column-end::: :::column::: :::column-end::: :::row-end:::

 

Asymmetric encryption and decryption

:::row::: :::column::: ENCRYPTBYASYMKEY :::column-end::: :::column::: DECRYPTBYASYMKEY :::column-end::: :::row-end::: :::row::: :::column::: ENCRYPTBYCERT :::column-end::: :::column::: DECRYPTBYCERT :::column-end::: :::row-end::: :::row::: :::column::: ASYMKEYPROPERTY :::column-end::: :::column::: ASYMKEY_ID :::column-end::: :::row-end:::

 

Signing and signature verification

:::row::: :::column::: SIGNBYASYMKEY :::column-end::: :::column::: VERIFYSIGNEDBYASMKEY :::column-end::: :::row-end::: :::row::: :::column::: SIGNBYCERT :::column-end::: :::column::: VERIGYSIGNEDBYCERT :::column-end::: :::row-end::: :::row::: :::column::: IS_OBJECTSIGNED :::column-end::: :::column::: :::column-end::: :::row-end:::

 

Symmetric decryption, with automatic key handling

:::row::: :::column::: DecryptByKeyAutoCert :::column-end::: :::row-end:::

 

Encryption hashing

:::row::: :::column::: HASHBYTES :::column-end::: :::row-end:::

 

Certificate copying

:::row::: :::column::: CERTENCODED (Transact-SQL) :::column-end::: :::column::: CERTPRIVATEKEY (Transact-SQL) :::column-end::: :::row-end:::

 

See also

Functions
Encryption Hierarchy
Permissions Hierarchy (Database Engine)
CREATE CERTIFICATE (Transact-SQL)
CREATE SYMMETRIC KEY (Transact-SQL)
CREATE ASYMMETRIC KEY (Transact-SQL)
Security Catalog Views (Transact-SQL)