感谢@PetSerAl,他说PowerShell中有OAEP填充但Python代码中没有(上面)。以下是使用PKCS1_OAEP模块编辑的python-decrypt代码。
Python的解密:
#!/usr/bin/python from Crypto.PublicKey import RSA from base64 import b64decode from base64 import b64encode from Crypto.Cipher import PKCS1_OAEP privKey = "<Private key in String>" encKey = "<encrypted String TO DECRYPT>" privKey = b64decode(privKey) r = RSA.importKey(privKey,passphrase=None) cipher = PKCS1_OAEP.new(r) encKey = b64decode(encKey) decKey = cipher.decrypt(encKey) print decKey with open('sucks.txt','w') as f: f.write(decKey)