
Anyone can help me Decrypt ?
i was getting problem to decrypt an encryption for password.<BR>the function was in ASP, below:<BR><BR>Function PHash( pValue )<BR>Dim dValue <BR>Dim dAccumulator<BR>Dim lTemp <BR>Dim sValue<BR>sValue = UCase(Trim("" & pValue))<BR>dAccumulator = 0<BR>For lTemp = 1 to Len(sValue)<BR>dValue = Asc(Mid(sValue, lTemp, 1))<BR>If (lTemp AND 1) = 1 Then<BR>dAccumulator = Sin( dAccumulator + dValue )<BR>Else<BR>dAccumulator = Cos( dAccumulator + dValue )<BR>End If<BR>Next<BR>dAccumulator = dAccumulator * CLng(10 ^ 9)<BR>PHash = CLng(dAccumulator) <BR>End Function<BR><BR>note: <BR> pValue is the password entered<BR> PHash is a function to encrypt the password <BR><BR>anyone can help me decrypt this formula ?i really appreciate !

RE: Anyone can help me Decrypt ?
Decrypt the foruma? What do you mean? <BR><BR>It converts sValue to an uppercase string and stores in sValue<BR>It sets dAccumulator to zero.<BR>It iterates through each character in sValue, assigning the ascii value of the char to dValue each time through.<BR>Depending on the iteration through, it then chooses where to assign the sin() of dAccumulator and dValue or the cos() of the same addition to dAccumulator.<BR>At the end it then multiplies dAccumulator by 10e9.<BR>It then returns the CLng() version of dAccumulator.<BR><BR>Is that good enough?<BR><BR>Craig.

RE: Anyone can help me Decrypt ?
thanks mate for ur explanation, but all i need here is to decrypt(it means change the password in encryption to normally as it was) ex. password when we enter from website : mypassword, after we apply the formula it maybe become 87434242. and what i m trying to is to change that 87434242 to mypassword. i am getting hard to make a formula reverse from that encryption. because the encryption formula was made by old programmer. and i was assigned to solve this. it is really confuse. are u have any idea or can help me ?

Can't be done...
This function does *NOT* guarantee that every password will hash to a unique value.<BR><BR>This is easy to prove: Consider a 10 character password. Say that we *only* allow letters in the password.<BR><BR>How many such passwords are there? The answer is easy: You have 26 choices for the first letter, 26 for the second, etc. So there are 26 ^ 9 possible passwords. (And remember, we aren't even allowing for passwords with digits or symbols in them.)<BR><BR>26 ^ 9 is roughly 6E+24. That is, a 6 with 24 zeroes after it. A 25 digit number!<BR><BR>Yet this PHash algorithm *never* returns a result that is more than 9 digits long! <BR><BR>In short: This is a pretty braindead encryption algorithm. And there is *certainly* no way to convert from the number back to the password. *EACH* of the possible encryption values could possibly translate to MORE THAN a MILLION BILLION different passwords.<BR><BR>

*IF* the passwords....
...are NEVER more than 6 characters long, and IF they are always upper case letters, only. *THEN* it is *POSSIBLE* you might be able to decrypt. But there's certainly no guarantee! The hashing algorithm is so braindead that it's possible that you might get duplicate hash values with only *TWO* character passwords, even!<BR><BR>The thing that *really* makes reversing the process hard (impossible) is that after getting a value with 15 or 16 digits of precision, the algorithm just arbitrarily chops off all but 9 digits and says "here you go". But even without that, the very nature of computer math would make it hard, as the SIN and COS functions are *NOT* completely accurate, *EVER*. But even less so when using only double precision math.<BR><BR>If you don't understand what I am talking about, then I don't know what more to tell you. Except...It can't be done.<BR><BR>
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

