从Nodejs应用程序接收到encryption密钥时长度错误不正确的密文

python中的PyCrypto需要帮助。 我试图解密从node.js应用程序获得的文本。
这就是我可以如何解密nodejs中的密钥

key.decrypt(<encrypted_text`, 'base64', 'utf8', ursa.RSA_PKCS1_PADDING) 

但是,当我尝试使用python PyCrypto模块解密相同的文本时,我得到错误。

这里是更多的细节:我想解密在Python中使用此代码:

 from Crypto.Cipher import PKCS1_v1_5 from Crypto.PublicKey import RSA from Crypto.Hash import SHA from Crypto.Hash import SHA from Crypto import Random from base64 import b64decode key = RSA.importKey(open('cert.key').read()) sentinel = Random.new().read(15+dsize) # Let's assume that average data length is 15 text = b64decode(<encrypted_text>) cipher = PKCS1_v1_5.new(key) message = cipher.decrypt(text, sentinel) print 'message =====>', message` 

我得到这个错误:

 --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-180-a1b00798e108> in <module>() 19 20 cipher = PKCS1_v1_5.new(key) ---> 21 message = cipher.decrypt(text, sentinel) 22 print 'message =====>', message, '\n' 23 digest = SHA.new(message[:-dsize]).digest() /Users/skapil/.virtualenvs/dave/lib/python2.7/site-packages/Crypto/Cipher/PKCS1_v1_5.pyc in decrypt(self, ct, sentinel) 202 # Step 1 203 if len(ct) != k: --> 204 raise ValueError("Ciphertext with incorrect length.") 205 # Step 2a (O2SIP), 2b (RSADP), and part of 2c (I2OSP) 206 m = self._key.decrypt(ct) ValueError: Ciphertext with incorrect length.