C Generate Random Symmetric Key
Returns one row for every symmetric key created with the CREATE SYMMETRIC KEY statement.
Column name | Data type | Description |
---|---|---|
name | sysname | Name of the key. Unique within the database. |
principal_id | int | ID of the database principal who owns the key. |
symmetric_key_id | int | ID of the key. Unique within the database. |
key_length | int | Length of the key in bits. |
key_algorithm | char(2) | Algorithm used with the key: R2 = RC2 R4 = RC4 D = DES D3 = Triple DES DT = TRIPLE_DES_3KEY DX = DESX A1 = AES 128 A2 = AES 192 A3 = AES 256 NA = EKM Key |
algorithm_desc | nvarchar(60) | Description of the algorithm used with the key: RC2 RC4 DES Triple_DES TRIPLE_DES_3KEY DESX AES_128 AES_192 AES_256 NULL (Extensible Key Management algorithms only) |
create_date | datetime | Date the key was created. |
modify_date | datetime | Date the key was modified. |
key_guid | uniqueidentifier | Globally unique identifier (GUID) associated with the key. It is auto-generated for persisted keys. GUIDs for temporary keys are derived from the user-supplied pass phrase. |
key_thumbprint | sql_variant | SHA-1 hash of the key. The hash is globally unique. For non-Extensible Key Management keys this value will be NULL. |
provider_type | nvarchar(120) | Type of cryptographic provider: CRYPTOGRAPHIC PROVIDER = Extensible Key Management keys NULL = Non-Extensible Key Management keys |
cryptographic_provider_guid | uniqueidentifier | GUID for the cryptographic provider. For non-Extensible Key Management keys this value will be NULL. |
cryptographic_provider_algid | sql_variant | Algorithm ID for the cryptographic provider. For non-Extensible Key Management keys this value will be NULL. |
Wanted to also give a small input. I had to implement a very similar function for a project of mine. I can't disclose the algorithm, however. But let me try to give you a couple small hints as to how you could further improve yours. Oct 05, 2016 The well-known System.Random class lets us generate random numbers quickly. However, the values provided by System.Random are not truly random. Instead, they are pseudo-random. The return values should only be used in case true randomness is not that important, such as in the classic number-guessing game. In case you need a random value to be.
Permissions
The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. For more information, see Metadata Visibility Configuration.
Remarks
Creating My Symmetric Key in C#. Ask Question. Should be random. If it is not random, it is easier to figure out by others. Unfortunately, it is not that trivial to generate random numbers by a computer. Simple random generation algorithms are cyclic, with a quite short cycle, so it is easy find the segment used for key. Symmetric keys don't need to be in any particular format - they're just a sequence of (pseudo)random bits. Most programming environments provide some sort of 'secure random' mechanism (a CSPRNG).You can use this to acquire a byte array of the appropriate length (e.g. 32 bytes for AES256), which can be used as a key.
Symmetric Key Authentication
The RC4 algorithm is deprecated. This feature will be removed in a future version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible.
Create Symmetric Key
Note
The RC4 algorithm is only supported for backward compatibility. New material can only be encrypted using RC4 or RC4_128 when the database is in compatibility level 90 or 100. (Not recommended.) Use a newer algorithm such as one of the AES algorithms instead. In SQL Server 2012 (11.x) material encrypted using RC4 or RC4_128 can be decrypted in any compatibility level.
Clarification regarding DES algorithms:
Symmetric Key Generation
DESX was incorrectly named. Symmetric keys created with ALGORITHM = DESX actually use the TRIPLE DES cipher with a 192-bit key. The DESX algorithm is not provided. /bitdefender-total-security-2015-license-key-generator.html. This feature is in maintenance mode and may be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Grid 2 activation key generator.
Symmetric keys created with ALGORITHM = TRIPLE_DES_3KEY use TRIPLE DES with a 192-bit key.
Symmetric keys created with ALGORITHM = TRIPLE_DES use TRIPLE DES with a 128-bit key.
See Also
Catalog Views (Transact-SQL)
Extensible Key Management (EKM)
Security Catalog Views (Transact-SQL)
Encryption Hierarchy
CREATE SYMMETRIC KEY (Transact-SQL)