-
Converting Encryption code in VBScript to Java
I've a code written in vbscript, which is already in use ..for encryption/decryption
of some data ... now, i want to convert the code into Java, and the converted
code should work same as the existing vbscript code...i mean it should de
giving me the same result...as i have to use the data already stored using
the vbscript code.
I'll write down the vbscript code over here... hope somebody can help me..
========
Sub Encrypt(Secret, Password)
'// "Secret" is the string to encrypt or decrypt. //
'// "PassWord" is the password with which to encrypt the string. //
Dim L, X, Char
L = Len(Password)
For X = 1 To Len(Secret)
Char = Asc(Mid(Password, (X Mod L) - L * ((X Mod L) = 0), 1))
Mid(Secret, X, 1) = Chr(Asc(Mid(Secret, X, 1)) Xor Char)
Next
End Sub
========
thanks in advance...cvshah.
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks