首页
社区
课程
招聘
[讨论]求助RSA用msieve 1024分解
发表于: 2020-2-6 22:35 12443

[讨论]求助RSA用msieve 1024分解

2020-2-6 22:35
12443
看雪大神云集,高手汇集,想问下以下的代码只有公钥,密文根据公钥可以算出,再用私钥解密出加密的明文,想求私钥,请问通过msieve能算出来吗?烦请大神指点或推荐工具吗? 不胜感谢,雪币重谢!

package lnqttioan;

import java.math.BigInteger;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.RSAPrivateKeySpec;
import java.security.spec.RSAPublicKeySpec;

import javax.crypto.Cipher;

public class RSA3 {
public static void main(String[] args) throws Exception{
//公钥加密
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
BigInteger modulus = new BigInteger("74012333486664938781784917319558621132853116184330140056431518519045738769048519249056658298166167763470840652490749373904013083030606481430471831114359564218640421134865601541504510679730861155149074228202153555958396574024051859098069905430336909436487040882153838831388394227045818116146099262275363316229",10);
BigInteger publicExponent = new BigInteger("65537");
RSAPublicKeySpec rsaPublicKeySpec = new RSAPublicKeySpec(modulus,publicExponent);
PublicKey publicKey = keyFactory.generatePublic(rsaPublicKeySpec);
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE,publicKey);
byte[]  encryptData = cipher.doFinal("Hello,RSA!".getBytes());
//System.out.println("encryptData:" + new String(encryptData));
//私钥解密
BigInteger privateExponent = new BigInteger("11894012485795125429143212982125995968250133812249035431503850146369069696745639939744949039417215906814088129637190783922930036322662731928921514950278998682712848452472751188416695902648346915331619305800219832154430379586340557456420648400558539747973551728237870781526760012558742029523629863397333781297",10);
RSAPrivateKeySpec rsaPrivateKeySpec = new RSAPrivateKeySpec(modulus,privateExponent);
PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);
cipher.init(Cipher.DECRYPT_MODE,privateKey);
byte[] decryptData = cipher.doFinal(encryptData);
System.out.println("decryptData:" + new String(decryptData));
}
}

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 2510
能力值: ( LV1,RANK:0 )
在线值:
发帖
回帖
粉丝
2
帮顶
2020-2-6 23:02
1
雪    币: 6
活跃值: (113)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
这个帖子是凉了没人了吗?
2020-9-28 18:20
0
雪    币: 14865
活跃值: (6088)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
想做注册机?
大数分解看多久能完成
2020-9-28 19:21
0
游客
登录 | 注册 方可回帖
返回
//