We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# -*- coding: utf-8 -*- """ file: test.py create: 2025/4/17 17:13 author: s0ing summary: """ from Crypto.Cipher import AES from Crypto.Util.Padding import pad import binascii ''' var pass = 1 const secretPassphrase = '4d8f3d65-d015-450d-8e75-58a50f5a' var key = CryptoJS.enc.Utf8.parse(secretPassphrase);//32位 var iv = CryptoJS.enc.Utf8.parse("1234567890000000");//16位 var password = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(pass), key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 }); password.ciphertext.toString() ''' passtr = 1 key = str('4d8f3d65-d015-450d-8e75-58a50f5a').encode('utf-8') iv = str('1234567890000000').encode('utf-8') # 创建 AES 加密器对象,使用 CBC 模式 cipher = AES.new(key, AES.MODE_CBC, iv) # 对数据进行 PKCS7 填充 padded_data = pad(str(passtr).encode('utf-8'), AES.block_size) # 执行加密操作 ciphertext = cipher.encrypt(padded_data) print(ciphertext) # 将密文转换为十六进制字符串 encrypted_hex = binascii.hexlify(ciphertext).decode('utf-8') print("加密后的密文(十六进制):", encrypted_hex)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: