

SQL Server Tips by Burleson 
Asymmetric Encryption / Decryption
Asymmetric Cryptography or Public Key Cryptography uses a pair of
different keys: a so called public key and a private key. The sender
of the message as its name suggests keeps the private key
confidential while the public key can be distributed to anyone who
wants it. If you encrypt a message with one key of the pair, then
only the other key can successfully decrypt the message. Public Key
Cryptography is 2 to 3 orders of magnitude slower than symmetric
algorithms, so normally it should not be used to encrypt bulk data.
Instead it is normally used to encrypt session keys for symmetric
algorithms.
RSA
RSA is a public key algorithm developed and named after its three
inventors: Ron Rivest, Adi Shamir, and Leonard Adleman. It was
originally devised in 1978 and is the most popular public key
algorithm in use. XP_CRYPTOAPI provides XP_RSA_ENCRYPT and
XP_RSA_DECRYPT for encryption / decryption using RSA. The basic
layout of the encryption and decryption algorithms is very similar
to their symmetric counterparts. Rather than creating a hash of the
password and deriving a session key from this, the key is directly
accessed from the CSP’s container (described later).
DSA
The National Institute of Standards and Technology (NIST) developed
the Digital Signature Algorithm as part of a proposal in 1991 for
use in their Digital Signature Standard (DSS). DSA is only meant to
be using for signatures and as such no XP’s are provided to perform
encryption / decryption of user data.
The above book excerpt is from:
Super SQL
Server Systems
Turbocharge Database Performance with C++ External Procedures
ISBN:
0976157322
Joseph Gama, P. J. Naughter
http://www.rampantbooks.com/book_2005_2_sql_server_external_procedures.htm 