Create a symmetric key in the database.
Syntax: CREATE SYMMETRIC KEY Sym_key [AUTHORIZATION owner] WITH key_options [, ... n] ENCRYPTION BY crypt [ , ... n ] Options crypt: CERTIFICATE certificate PASSWORD = 'password' SYMMETRIC KEY symmetric_key_name ASYMMETRIC KEY asym_key_name key_options: KEY_SOURCE = 'pass_phrase' ALGORITHM = algorithm IDENTITY_VALUE = 'identity_phrase' algorithm: DES | TRIPLE_DES | RC2 | RC4 | RC4_128 | DESX | AES_128 | AES_192 | AES_256 Key: Sym_key Unique name for the symmetric key. Temporary keys should begin with # password Used to derive a TRIPLE_DES key, p/w complexity is checked. symmetric_key_name Used to encrypt the key being created. Must already be open asym_key_name Asymmetric key used to encrypt the key being created. Must already be open pass_phrase A pass phrase from which to derive the key. identity_phrase A phrase used to generate a GUID - for data encryption with a temporary key.
RC4 and RC4_128 are not recommended for use with sensitive data.
Temporary keys are only valid for the current session.
Examples
CREATE SYMMETRIC KEY ss64 WITH ALGORITHM = AES_256
ENCRYPTION BY CERTIFICATE cert64;
GO
"Success is not the key to happiness. Happiness is the key to success. If you love what you are doing, you will be successful" ~ Herman Cain
Related Commands:
ALTER SYMMETRIC KEY
DROP SYMMETRIC KEY
sys.symmetric_keys