Paip. cross-platform custom Encryption Method
Currently, parameters are transmitted between ASP and PHP system modules. For convenience, you do not need to use MD5 signatures.
DES encryption .. However, DES in ASP and PHP cannot be encrypted with each other... What CBC mode and IV vector are there?
. A lot of data. I still can't adjust it for a long time. Forget it. Write your own encryption method ..
The main method of password encryption is to replace and shift .. In addition, I want to use keys and algorithms.
Simple .. The DES algorithm is a big problem, MD, and difficult to use. PASS... Although the results are good, it is a bit complicated and difficult to rewrite.
..
Here, I have conceived the idea of encryption and encryption:
1. First reverse the string
2. cyclically add strings and KEY groups
3. The added result is converted into hexadecimal characters .. It is mainly used to save some space ..
4. The returned result is OK...
5. The decryption process can be reversed ..
Dim key_L71723
Key_L71723 = "iluvnjyn"
Dim msg
Msg = "admin"
Dim newstr
Newstr = atiEncode (msg, key_L71723)
Response. Write (newstr) 'shows that the encryption result is D7D5E2DACF
Response. Write (atiDecode (newstr, key_L71723 ))
---------------------------------------------
Function atiEncode (msg, key)
Msg = back_str (msg) 'reverse the string
Dim key_L71723
Key_L71723 = key
Key_L71723 = key_L71723 + key_L71723
Key_L71723 = key_L71723 + key_L71723
Key_L71723 = key_L71723 + key_L71723
Dim msgarr
Msgarr = str2array (msg)
Dim keyarr
Keyarr = str2array (key_L71723)
Dim newstr
Newstr = ""
'And the KEY group are added cyclically
For I = 0 to ubound (msgarr)
Dim char
Char = msgarr (I)
Dim newchar 'int format
Newchar = asc (char) + asc (keyarr (I ))
Newchar = hex (newchar)
Newstr = newstr + cstr (newchar)
Next
AtiEncode = newstr
End function
Function atiDecode (msg, key)
Dim key_L71723
Key_L71723 = key
Key_L71723 = key_L71723 + key_L71723
Key_L71723 = key_L71723 + key_L71723
Key_L71723 = key_L71723 + key_L71723
Dim msgarr
Msgarr = str2arrayx (msg, 2)
Dim keyarr
Keyarr = str2array (key_L71723)
Dim newstr
Newstr = ""
For I = 0 to ubound (msgarr)
Dim charInt
CharInt = chn10 (msgarr (I) 'encode char
Dim newchar www.2cto.com
Newchar = chr (charInt-ascw (keyarr (I )))
Newstr = newstr + newchar
Next
Newstr = back_str (newstr)
AtiDecode = newstr
End function
Author: attilax