none
Cannot access SHA512CryptoServiceProvider class RRS feed

  • Question

  • Hi,

    I am new to .NET and please pardon me if this is a repeat question.

    I am trying to a create a dll thru C# Express which would hash a password along with a Salt.  I have included the following namespaces

    using System;
    using System.Security.Cryptography;

    My problem is I couldn't access the SHA512CryptoServiceProvider class.  I could access the SHA1CryptoServiceProvider, SHA256, SHA512, SHA512Managed class.  I want to use SHA512CryptoServiceProvider because I believe it is FIPS 140-2 compliant.  My pc is a Window 8 and I under Control Panel > Program and Feature I saw Microsoft .NET v4.5 is installed.  What am I mssing here?

    Sam

    Thursday, December 19, 2013 3:16 PM

Answers

  • Make sure you add the two library below to the top of your module.  Also go to menu Project - Add references and in the Net tab add the System.Securtity library.  Often the default library for a class in VS is missing objects and simply adding the library in the refernce view will resolve the issue.

    using System.Security;
    using System.Security.Cryptography;


    jdweng

    Thursday, December 19, 2013 3:57 PM

All replies

  • Make sure you add the two library below to the top of your module.  Also go to menu Project - Add references and in the Net tab add the System.Securtity library.  Often the default library for a class in VS is missing objects and simply adding the library in the refernce view will resolve the issue.

    using System.Security;
    using System.Security.Cryptography;


    jdweng

    Thursday, December 19, 2013 3:57 PM
  • Thank you, jdweng!  I added the missing namespace and the SHA512CryptoServiceProvider class appear on the drop down for me to select.

    Sam

    Thursday, December 19, 2013 4:47 PM