Hi, I wrote an encryption function for my chat application (storing username and password). It's only thought for encode and there's no way to get the original word back, but you don't need this if you want to check for passwords...
Code:'Function returns encoded string Function eNcode(Text As String) As String 'eNcode algorithm 'Copyright © by Fox '[email protected] 'No comments in this function, you'll know why ;-) Dim A As Long Dim Code As Long Dim Temp As Long Dim Result As String If Text = "" Then Encode = "" Exit Function End If For A = 1 To Len(Text) Code = Asc(Mid(Text, A, 1)) Temp = Int(Sin(Code) * Cos(Code * Code) + Cos(Code) * Asc(Mid(Text, 1, 1)) * Sin(Code) * Cos(Code)) - (A + Code) Code = Int(Asc(Mid(Text, A, 1)) * A * IIf(Temp = 0, 15, Temp) / (A + 1)) - A While Code < 0 Code = Code * Code - A + Sin(A) * A Wend While Code > 255 Code = Int(Code / 1.577) Wend Result = Result & Chr(Code) Next A = A + Sqr((Code + A) * (Code + A)) While Len(Result) < MIN_ENCODE_LENGTH Code = A Temp = Int(Sin(Code) * Cos(Code * Code) + Cos(Code) * A * Sin(Code) * Cos(Code)) - (A + Code) Code = Temp + 1 While Code < 0 Code = Code * Code - A + Sin(A) * A Wend While Code > 255 Code = Int(Code / 1.577) Wend Result = Result & Chr(Code) A = A + 1 Wend Encode = Result End Function




Reply With Quote