建设视频网站要求,网络营销策划推广方案,广州手机网站定制如何,营销型网站 平台我相信這是一個非常基本的問題#xff0c;但我開始使用JavaScript和RSA進行研究#xff0c;所以我有點失落。我剛剛下載了Cryptico庫#xff0c;它爲我提供了一個易於使用的RSA密鑰生成/加密/解密。從Cryptico.js中提取RSA私鑰publicKeyString(RsaKey)哪個#xff1a;my.pu…我相信這是一個非常基本的問題但我開始使用JavaScript和RSA進行研究所以我有點失落。我剛剛下載了Cryptico庫它爲我提供了一個易於使用的RSA密鑰生成/加密/解密。從Cryptico.js中提取RSA私鑰publicKeyString(RsaKey)哪個my.publicKeyString function(rsakey){pubkey my.b16to64(rsakey.n.toString(16));return pubkey;}的rsakey.n定義所生成的RSA密鑰的公共部分可以很容易地只使用命令來提取同時在函數中生成密鑰function RSAGenerate(B, E){var rng new SeededRandom();var qs B 1;this.e parseInt(E, 16);var ee new BigInteger(E, 16);for (;;){for (;;){this.p new BigInteger(B - qs, 1, rng);if (this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) 0 this.p.isProbablePrime(10)) break;}for (;;){this.q new BigInteger(qs, 1, rng);if (this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) 0 this.q.isProbablePrime(10)) break;}if (this.p.compareTo(this.q) 0){var t this.p;this.p this.q;this.q t;}var p1 this.p.subtract(BigInteger.ONE);var q1 this.q.subtract(BigInteger.ONE);var phi p1.multiply(q1);if (phi.gcd(ee).compareTo(BigInteger.ONE) 0){this.n this.p.multiply(this.q);this.d ee.modInverse(phi);this.dmp1 this.d.mod(p1);this.dmq1 this.d.mod(q1);this.coeff this.q.modInverse(this.p);break;}}}但是私有部分的關鍵我只是不明白如何提取所以我將能夠保存公鑰/私鑰部分並可供以後使用。