Anyone can help me Decrypt ?

# Thread: Anyone can help me Decrypt ?

1. Junior Member
Join Date
Dec 1969
Posts
2

## 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 !

2. Senior Member
Join Date
Dec 1969
Posts
16,931

## 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.

3. Junior Member
Join Date
Dec 1969
Posts
2

## 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 ?

4. Senior Member
Join Date
Dec 1969
Posts
96,118

## 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&#039;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>

5. Senior Member
Join Date
Dec 1969
Posts
96,118