<%
Key = "office"
Function Encrypt(Text)
For Char = 1 To LEN(Text)
TextCharCode = ASC(MID(Text,Char,1))
PasswordCharCode = ASC(MID(Key,(Char MOD LEN(Key) + 1),1))
NewCharCode = TextCharCode + PasswordCharCode
If NewCharCode > 255 Then NewCharCode = NewCharCode - 255
Encrypt = Encrypt & CHR(NewCharCode)
NEXT
End function
Function Decrypt(Text)
For Char = 1 To LEN(Text)
CodeCharCode = ASC(MID(Text,Char,1))
PasswordCharCode = ASC(MID(Key,(Char MOD LEN(Key) + 1),1))
OriginalCharCode = CodeCharCode - PasswordCharCode
If OriginalCharCode < 1 Then OriginalCharCode = OriginalCharCode + 255
Decrypt = Decrypt & CHR(OriginalCharCode)
NEXT
End function
%>
Tag : ASP, Ms SQL Server 2008, Web (ASP.NET), VS 2010 (.NET 4.x), Windows