Go Back   FlashFXP Forums > > > >

ioFTPD General New releases, comments, questions regarding the latest version of ioFTPD.

Thread Tools Rate Thread Display Modes
Old 11-25-2005, 01:51 PM   #1
Join Date: Dec 2004
Posts: 46
Default SHA1 Hash

Not sure why but when i compute the SHA1 hash in .NET and compare what is found in the password file i get problems. Pasted code below

current = hash in user file
strHex = computed hash

UnicodeEncoding UE = new UnicodeEncoding();

byte[] HashValue, MessageBytes = UE.GetBytes(password.Trim());
System.Security.Cryptography.SHA1Managed SHhash = new System.Security.Cryptography.SHA1Managed();
string strHex = "";

HashValue = SHhash.ComputeHash(MessageBytes);

foreach(byte b in HashValue) {

strHex += String.Format("{0:x2}", b);

if(current == strHex)
return true;
return false;

Can anyone help?

current = cc714d9311474c5167ed05c9a8f7a2462533e156
strHex = c4bd41cfd6d8762f3e8c9d5209ff610f1e2bb49e
ganymede is offline   Reply With Quote
Old 11-26-2005, 02:24 AM   #2
Join Date: Dec 2004
Posts: 46

FIXED :for those of you who care want to know :

//UnicodeEncoding UE = new UnicodeEncoding();
System.Text.UTF8Encoding UE = new UTF8Encoding();
ganymede is offline   Reply With Quote

file, hash, hashvalue, return, strhex

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 11:59 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)