Results 1 to 3 of 3

Thread: Hashing a string value using SHA1 algorithm

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    4

    Hashing a string value using SHA1 algorithm

    Hi guys...

    Very very urgent!!

    I am trying to Hash the string 'Test' and then converting it to base64string, but some how I am having a doubt that if this is running correct.

    Please copy the code below and run the code, tell me the return param or value of 'Output' variable. I have written down the result on my system kindly compare the same on ur system and update me if the result is the same or not. Kindly update me at the earliest

    string Input;
    string Output;
    Input = "Test";
    System.Security.Cryptography.SHA1 sha1 = System.Security.Cryptography.SHA1.Create();
    byte[] hash = sha1.ComputeHash(System.Text.Encoding.UTF8.GetBytes(Input ));
    Output = Convert.ToBase64String(hash);
    MessageBox.Show(Output);

    //Output: ZAqyuuB77cTBY/Z5p0b3q3+10fo=

    Thankyou,

    Praveen

  2. #2
    Junior Member
    Join Date
    Feb 2005
    Posts
    31

    Re: Hashing a string value using SHA1 algorithm

    I got ZAqyuuB77cTBY/Z5p0b3q3+10fo=

    Dan

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    4

    Resolved Re: Hashing a string value using SHA1 algorithm

    Hi Dan,

    Thankx for testing the code... and also the problem has been rectified. Thank you once again.

    Regards,

    Praveen
    Last edited by pravvu; Apr 28th, 2005 at 08:44 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width