Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Anyone can help me Decrypt ?

    i was getting problem to decrypt an encryption for password.
    the function was in ASP, below:

    Function PHash( pValue )
    Dim dValue
    Dim dAccumulator
    Dim lTemp
    Dim sValue
    sValue = UCase(Trim("" & pValue))
    dAccumulator = 0
    For lTemp = 1 to Len(sValue)
    dValue = Asc(Mid(sValue, lTemp, 1))
    If (lTemp AND 1) = 1 Then
    dAccumulator = Sin( dAccumulator + dValue )
    Else
    dAccumulator = Cos( dAccumulator + dValue )
    End If
    Next
    dAccumulator = dAccumulator * CLng(10 ^ 9)
    PHash = CLng(dAccumulator)
    End Function

    note:
    - pValue is the password entered
    - PHash is a function to encrypt the password

    anyone can help me decrypt this formula ?i really appreciate !

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    Code:
    Function PHash( pValue )
       Dim dValue 
       Dim dAccumulator
       Dim lTemp 
       Dim sValue
       sValue = UCase(Trim("" & pValue)) 'no idea what the .."" & .. is for.. seems useless
       dAccumulator = 0
       For lTemp = 1 to Len(sValue)
          dValue = Asc(Mid(sValue, lTemp, 1)) 'use chr() to take asc() out.. i think
          If (lTemp AND 1) = 1 Then
             dAccumulator = Sin( dAccumulator  + dValue ) 'this will need an arcsin, i dont know if this function is there
          Else
             dAccumulator = Cos( dAccumulator  + dValue ) '..arccos...
          End If
       Next
       dAccumulator = dAccumulator * CLng(10 ^ 9) 'devide by 1,000,000,000
       PHash = CLng(dAccumulator) 
    End Function
    basically you want to loop though each character backwards going up the process instead of down it.. im way too lazy for this and im not sure if it even works but someone else will prob help ya


  •  

    Posting Permissions

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