Skip to content

Commit

Permalink
Revert "修复了在python高版本下md4算法失效的问题"
Browse files Browse the repository at this point in the history
  • Loading branch information
moyuwa authored Mar 6, 2024
1 parent 1d31b80 commit d4b2c48
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions genpwdhash.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/usr/bin/env python3
# coding=utf-8
# python version 3.7 by 6time
# fixed by b3nguang
# 生成密码的各种哈希

import hashlib, binascii, sqlite3, base64
import config1
from gmssl import sm3, func
from Crypto.Hash import MD4

"""
各种哈希算法
Expand Down Expand Up @@ -39,10 +37,10 @@ def pwdsha256(password, encode='utf-8'):


def pwdntlm(password, encode='utf-8'):
md4 = MD4.new()
md4.update(password.encode(encoding=encode))
return md4.hexdigest()

# n = hashlib.new('md4', text.encode('utf-16le'))
n = hashlib.new('md4')
n.update(password.encode('utf-16le'))
return binascii.hexlify(n.digest()).decode()


def pwdmysql(password, encode='utf-8'):
Expand Down

1 comment on commit d4b2c48

@moyuwa
Copy link
Owner Author

@moyuwa moyuwa commented on d4b2c48 Mar 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1

Please sign in to comment.