用友861以后用户密码加密算法

admin   ·   发表于 2个月前   ·   用友

简单的很, sha1("用户明文密码")+base64, 后面再补个0x03字符

python代码验证:

import base64
import hashlib

def main(pwd):

    s=hashlib.sha1()
    s.update(pwd)
    a = base64.b64encode(s.digest())

    print(a)

if __name__ == '__main__':
    main(''.encode("utf8"))#这里注意必须utf8

结果:
D:\Python\Python38\python.exe C:/Users/administrator/iCloudDrive/Documents/program/study/main.py
b'2jmj7l5rSw0yVb/vlWAYkK/YBwk=\x00\x00\x00'
<class 'bytes'>

Process finished with exit code 0


Button btn = (Button)sender;
            btn.Text = "2134234";
            
            SHA1 sha1 = SHA1.Create();
            byte[] bytResult = sha1.ComputeHash(Encoding.UTF8.GetBytes(textBox1.Text.ToString()));
            string pwdAfter = Convert.ToBase64String(bytResult);
            textBox2.Text = pwdAfter + (Char)0x03;

这里的密码规则适合U8,不适合T6


0 Reply   |  Until 2个月前 | 47 View
LoginCan Publish Content