Tech Off Thread

5 posts

SHA512 in visual studio 2008 and .net 3.5

Back to Forum: Tech Off
  • User profile image
    Varunkrishna

    Hi all

    I am using visual studio 2008 and dot net 3.5. I am trying to encrypt a string, but when I use the SHA1 it works fine, but when I try the same with SHA256,SHA384,SHA512 . I am getting the following error

    the type or namespace name "SHA512" could not be found (are you missing a using directive or an assembly refrence ?)

    and similarly for the other SHA256 and SHA384. And when I type the SHA in the visual studio I am only getting the following things

    1. SHA1
    2. SHA1CryptoServiceProvider
    3. SHA1Managed

    and it doesn't list any of the other SHA256,SHA384,and SHA512. What am I missing here ? 

    P.S.

    I am using using System.Security.Cryptography;

    Thanks,

    Varun Krishna. P

  • User profile image
    figuerres

    do you have the namespaces imported in your project ?

    do you have them in the project references dialog ?

  • User profile image
    cheong

    @figuerres:It's in the mscorlib so there aren't much possibility for not having them imported.

    By comparing the documentation for these class... any chance you're developing for Compact Framework? In that case only SHA1 related classes are available.

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    Varunkrishna

    @figuerres:

    Yes, I had imported the namespace using using System.Security.Cryptography; and also added the reference to my project.. Cheong is correct, for CF it only lists SHA1's.

     

     

    Thanks

    Varun Krishna. P

  • User profile image
    Varunkrishna

    @cheong:

    Yes,Cheong you are absolutely correct, for Compact Framework it only lists SHA1's. So I had cross checked it yesterday with WPF application and it lists all the SHA1's SHA256's, SHA384's and SHA512's.

     

     

    Thanks

    Varun Krishna. P

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.