Skip to content

Latest commit

 

History

History
86 lines (70 loc) · 3.81 KB

cryptographic-functions-transact-sql.md

File metadata and controls

86 lines (70 loc) · 3.81 KB
title ms.custom ms.date ms.prod ms.prod_service ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Cryptographic Functions (Transact-SQL) | Microsoft Docs
07/24/2017
sql
database-engine, sql-database
sql
t-sql
language-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
16
edmacauley
edmaca
craigg

Cryptographic functions (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-asdb-xxxx-xxx-md]

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

Symmetric encryption and decryption

ENCRYPTBYKEY DECRYPTBYKEY
ENCRYPTBYPASSPHRASE DECRYPTBYPASSPHRASE
KEY_ID KEY_GUID
DECRYPTBYKEYAUTOASYMKEY KEY_NAME
SYMKEYPROPERTY

Asymmetric encryption and decryption

ENCRYPTBYASYMKEY DECRYPTBYASYMKEY
ENCRYPTBYCert DECRYPTBYCERT
ASYMKEYPROPERTY ASYMKEY_ID

Signing and signature verification

SIGNBYASYMKEY VERIFYSIGNEDBYASMKEY
SIGNBYCERT VERIGYSIGNEDBYCERT
IS_OBJECTSIGNED

Symmetric decryption, with automatic key handling

DecryptByKeyAutoCert

Encryption hashing

HASHBYTES

Certificate copying

CERTENCODED (Transact-SQL)
CERTPRIVATEKEY (Transact-SQL)

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)