none
Error generating Asymmetric Keys RRS feed

  • Question

  • Hi

    I'm working on an SQL Server 2005 DB (SQL Server Standard Edition - Version 9.00.4035.00)

     

    I've been told the server that the database is running Microsoft 2003.

    When I look in SQL Server DB properties it says Operating System = Microsoft Windows NT 5.2 (3790)

    Looking at the operating system details on the server MS Windows 2003 Standard Edition, 5.2.3790 Service Pack 2 Build 3790.

    If I create symmetric keys using the following statement everything works fine

    CREATE SYMMETRIC KEY TestTableKey2
    WITH ALGORITHM = AES_256 ENCRYPTION
    BY CERTIFICATE EncryptTestCert

    If I try to create an asymmetric keys using the following statement

    CREATE ASYMMETRIC KEY TestTableKey3
        WITH ALGORITHM = AES_256
        ENCRYPTION BY PASSWORD = '#1_2%3*4)5~6';

    I get the following error :

    Msg 15314, Level 16, State 1, Line 1
    Either no algorithm has been specified or the bitlength and the algorithm specified for the key are not available in this installation of Windows.

    I know that AES encryption will only work on Windows 2003 which is what people say is the reason for the error message.

    Is that the case here, I can use the AES_256 encryption when creating symmetric keys, but only get the error when creating an asymmetric key.

    Thanks in advance for your assistance.

     

     

     

     

     

     

     

    Sunday, September 26, 2010 5:12 AM

Answers

  • Hi IWDukes,

     

    According to the error message, "Msg 15314, Level 16, State 1, Line 1 Either no algorithm has been specified or the bitlength and the algorithm specified for the key are not available in this installation of Windows.", the possible reason for this issue is that AES_256 cannot be used in the Transact-SQL of CREATE ASYMMETRIC KEY. There are only three parameters like below:  <algorithm> ::= { RSA_512 | RSA_1024 | RSA_2048 }

     

    But in the Transact-SQL of CREATE SYMMETRIC KEY, AES_256 is an valid algorithm parameter, that’s why you can use the AES_256 encryption when creating symmetric keys, but got error when you use it to create asymmetric keys:

    <algorithm> ::= DES | TRIPLE_DES | TRIPLE_DES_3KEY | RC2 | RC4 | RC4_128| DESX | AES_128 | AES_192 | AES_256

     

    please refer to the following links for details:

    CREATE ASYMMETRIC KEY (Transact-SQL): http://msdn.microsoft.com/en-us/library/ms174430.aspx

    CREATE SYMMETRIC KEY (Transact-SQL): http://msdn.microsoft.com/en-us/library/ms188357.aspx

     

    If there are more questions, please feel free to ask.

     

    Thanks,

    Grace


    Please kindly mark the answer if it is a workaround. Thanks a lot *^_^*
    • Marked as answer by IWDukes Tuesday, September 28, 2010 6:47 AM
    Monday, September 27, 2010 9:36 AM

All replies

  • What is the output of the following

    SELECT

     

    * FROM sys.symmetric_keys


    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Sunday, September 26, 2010 7:51 AM
  • What is the output of the following

    SELECT

     

    * FROM sys.symmetric_keys


    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    Sunday, September 26, 2010 7:51 AM
  • The query returns :

    name               principal_id symmetric_key_id key_length key_algorithm algorithm_desc    create_date                    modify_date                    key_guid
    TestTableKey2                1                      257            256                  A3          AES_256   2010-09-27 08:49:11.890 2010-09-27 08:49:11.903 84C54D00-6F53-4AED-AA71-BE8A039655C2

    Sunday, September 26, 2010 10:55 PM
  • Hi IWDukes,

     

    According to the error message, "Msg 15314, Level 16, State 1, Line 1 Either no algorithm has been specified or the bitlength and the algorithm specified for the key are not available in this installation of Windows.", the possible reason for this issue is that AES_256 cannot be used in the Transact-SQL of CREATE ASYMMETRIC KEY. There are only three parameters like below:  <algorithm> ::= { RSA_512 | RSA_1024 | RSA_2048 }

     

    But in the Transact-SQL of CREATE SYMMETRIC KEY, AES_256 is an valid algorithm parameter, that’s why you can use the AES_256 encryption when creating symmetric keys, but got error when you use it to create asymmetric keys:

    <algorithm> ::= DES | TRIPLE_DES | TRIPLE_DES_3KEY | RC2 | RC4 | RC4_128| DESX | AES_128 | AES_192 | AES_256

     

    please refer to the following links for details:

    CREATE ASYMMETRIC KEY (Transact-SQL): http://msdn.microsoft.com/en-us/library/ms174430.aspx

    CREATE SYMMETRIC KEY (Transact-SQL): http://msdn.microsoft.com/en-us/library/ms188357.aspx

     

    If there are more questions, please feel free to ask.

     

    Thanks,

    Grace


    Please kindly mark the answer if it is a workaround. Thanks a lot *^_^*
    • Marked as answer by IWDukes Tuesday, September 28, 2010 6:47 AM
    Monday, September 27, 2010 9:36 AM
  • Thank you Grace

    You're 100% correct.

    Appreciate your help.

    Tuesday, September 28, 2010 6:48 AM