Skip to content

Latest commit

 

History

History
86 lines (70 loc) · 3.81 KB

File metadata and controls

86 lines (70 loc) · 3.81 KB
title Cryptographic Functions (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 07/24/2017
ms.prod sql
ms.prod_service database-engine, sql-database
ms.reviewer
ms.suite sql
ms.technology t-sql
ms.tgt_pltfrm
ms.topic language-reference
dev_langs
TSQL
helpviewer_keywords
functions [SQL Server], cryptographic
crypto functions
cryptography [SQL Server], functions
decryption [SQL Server], functions
security functions
encryption [SQL Server], functions
ms.assetid 0be5626b-5a25-4d8c-9f44-7abbfccf816c
caps.latest.revision 16
author MashaMSFT
ms.author mathoma
manager 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)