google了好久还是没懂。。都是生成随机的公钥。
js版本的原代码是这样的
var exponent='110001'
var modulus='008d74da20e11ca5646fe8581372f7179382a66ce20913ab753bc4c10ccf2ac53393cbcd12d6108940fbd84913df29ba1867b3a5eacd00fece324216476ab70b5ff943776955ad4d56851258b0718192a21b649560c6b21364ec7989cc378'
var publicKey = RSAUtils.getKeyPair(exponent, '', modulus);
RSAUtils.encryptedString(publicKey, param);
如何以python3的代码实现?
顺便还有一个问题,在安装pycrypto的时候提示
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
,google的解决办法是
apt-get install python3-dev
但是并没有效果,依然如此报错,环境是ubuntu14.04
十分感谢
rsa的js代码在此gist
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
认证0级讲师