Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 convert login to asp.net c# / SHA256
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

amigo_fd
Starting Member

3 Posts

Posted - 12 April 2006 :  02:14:18  Show Profile
Hello,

I want to use the members database of snitz forum on an other part of the site which is written in ASP.NET C#. I found an easy way to convert the password to SHA256 but this returns me an other value than the one stored in the database.

Any ideas why ?

This is my code:

public string GetHash(string strPlain) {
string strRet = "";

HashAlgorithm hash = new SHA256Managed();

byte[] messageBytes = System.Text.Encoding.UTF8.GetBytes(strPlain);
byte[] HashValue = hash.ComputeHash(messageBytes);

strRet = Convert.ToBase64String(HashValue);
//strRet = HashValue.ToString();

return strRet;
}

password in the database:
UwKsxooegmiNHo/VhytG6iMoQSeWTV4Df5CD49c0Vzo=

password returned from this code:
5302acc68a1e82688d1e8fd5872b46ea23284127964d5e037f9083e3d734573a

Any ideas ?

Thanks a lot,
Frank

amigo_fd
Starting Member

3 Posts

Posted - 12 April 2006 :  02:17:10  Show Profile
sorry, it's the other way around ...

password in the database:
5302acc68a1e82688d1e8fd5872b46ea23284127964d5e037f9083e3d734573a

password returned from this code:
UwKsxooegmiNHo/VhytG6iMoQSeWTV4Df5CD49c0Vzo=
Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 12 April 2006 :  03:13:33  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Try HuwR's version

public static string SHA256Hash(string Data)
{
        SHA256 sha = new SHA256Managed();
        byte[] hash = sha.ComputeHash( Encoding.ASCII.GetBytes(Data) );

        StringBuilder stringBuilder = new StringBuilder();
        foreach( byte b in hash ) 
        {
            stringBuilder.AppendFormat("{0:x2}", b);
        }
        return stringBuilder.ToString();
    }


Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

Edited by - Podge on 12 April 2006 03:13:55
Go to Top of Page

amigo_fd
Starting Member

3 Posts

Posted - 12 April 2006 :  03:40:51  Show Profile
waw, thanks a lot, that one works perfectly !!!
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 15 September 2006 :  13:50:20  Show Profile  Send mafifi an ICQ Message
I am trying to use SHA 256 with different application.
  • Is there a way to covert the ASP version of SHA256 into DLL?
  • If yes, I would very much appreciate all the help I can get.
  • The password encryption by SHA256 is not reversible, right?


Regards,

Mo
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 15 September 2006 :  14:17:35  Show Profile  Visit HuwR's Homepage
what kind of application ? why do you need it in a dll ?

sha256 is not reversible
Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 15 September 2006 :  14:44:36  Show Profile  Send mafifi an ICQ Message
http://www.flicks.com/prod.htm#authnx it uses Base64 which we do not want to use. AuthentiX uses a dll for the encryption to work so if I can take the SHA256 and convert it to DLL, I will be fine (I think).

Regards,

Mo
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 15 September 2006 :  17:26:24  Show Profile  Visit HuwR's Homepage
yes it should be possible to make a dll to do it, you may even find there is one already, try searching on google
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07