IMail encryption algorithm and vbs implementation

Source: Internet
Author: User

All the post office information of IMail, such as user and password, is actually stored in the computer registry.
Open the Registry to view all information in Imail, including the user's password.
Details:
IMail stores all enterprise Post Office Information in:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Ipswitch \ IMail \ Domains \ <domainname> \ Users \ <username>
In such a key, domainname is the post office name, username is the user name, and a key value named password under <username> is the stored user password. the password is not stored in plaintext, but generated after the simple encryption operation. The encryption process is as follows:
1. Read the username and convert all the usernames to lowercase letters.
2. convert each number of the user name into the corresponding ASCII code.
3. Calculate the offset of each letter and the first letter in the user name.
4. Calculate the ASCII code corresponding to each letter of the password.
5. Add each ASCII code of the password to the reference value (ASCII of the first letter of the user name minus 97) and the offset corresponding to the user name.
6. corresponding to the password table, you can get the password.
Details Program As follows:

Sub initcode (byref Infos) 'automatically generates a password table
Count =-97
Codearray = array ("0", "1", "2", "3", "4", "5", "6", "7", "8 ", "9", "A", "B", "C", "D", "E", "F ")
For z = 0 to ubound (codearray)
For y = 0 to ubound (codearray)
Infos. Add CSTR (count), codearray (z) & codearray (y)
Count = count + 1
Next
Next
End sub

function getimailpassword (user, pass) 'imail password encryption function
encryptcode = ""
set objdict = Createobject ("scripting. dictionary ")
call initcode (objdict)
User = lcase (User) 'converts the user to lowercase
firstchar = left (user, 1)
firstcharcode = ASC (firstchar) 'Get the ASCII code of the first letter
reference = FirstCharCode-97' Get the reference value
execute "dim usercode (" & Len (User) -1 & ")" 'defines two Arrays for storing the user and password ASCII.
execute "dim passcode (" & Len (PASS)-1 &") "
for I = 0 to Len (User)-1 'Get the offset of user letters
uchar = ASC (mid (user, I + ))
usercode (I) = firstcharcode-uchar
next
for J = 0 to Len (PASS) -1 'obtain the new password value
pchar = ASC (mid (Pass, J +)
IPOs = J mod Len (User)
passcode (j) = pchar + reference-usercode (IPOs)
next
for k = 0 to ubound (passcode) 'query the password table, obtain the password
encryptcode = encryptcode & objdict. item (CSTR (passcode (k)
next
getimailpassword = encryptcode
end function

iuser = "web9898" 'IMail user name for testing
IPASS = "web9898.cn"' IMail password for testing
wscript. echo IPASS & "the encrypted password is:" & getimailpassword (iuser, IPASS)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.