решение RSA при мaлых числах.
здесь один филипинец говорил что он нашел решение на 80%.
http://www.seedmuse.com/rsa_edit.htm
смотреть: "As I have said before, D is not necessarily equal to private key (d). This means, other keys can decipher the code. The decoding may not be 100% but based on my few tests, it is above 80%"...
ну, я нашел 100%ное решение, кому то интересно будет?
хотя должен сразу сказать, что это брут-форсе решение, и при большых числах - много времени занимает что исключет практическое применение.
Код написан на Java.
Код:
BigInteger mod = BigInteger.valueOf(33);
BigInteger d = BigInteger.valueOf(3);
for (int i = 0; i < 33; i++) {
BigInteger m = BigInteger.valueOf(i);
BigInteger c = m.modPow(d, mod);
int times = d.intValue();
int counter = 1;
while (!c.modPow(BigInteger.valueOf(times), mod).equals(c)) {
times = times + d.intValue();
counter++;
}
System.out.print("mes = " + m);
System.out.print(", cipher = " + c);
BigInteger decipher = c.modPow(BigInteger.valueOf(counter), mod);
System.out.println(", my minimum e = " + counter + ", decipher = " + decipher);
}
Например при числах от 0 до 32(так как потолок 33 при модуле 33).
Код:
mes = 0, cipher = 0, my minimum e = 1, decipher = 0
mes = 1, cipher = 1, my minimum e = 1, decipher = 1
mes = 2, cipher = 8, my minimum e = 7, decipher = 2
mes = 3, cipher = 27, my minimum e = 2, decipher = 3
mes = 4, cipher = 31, my minimum e = 2, decipher = 4
mes = 5, cipher = 26, my minimum e = 7, decipher = 5
mes = 6, cipher = 18, my minimum e = 7, decipher = 6
mes = 7, cipher = 13, my minimum e = 7, decipher = 7
mes = 8, cipher = 17, my minimum e = 7, decipher = 8
mes = 9, cipher = 3, my minimum e = 2, decipher = 9
mes = 10, cipher = 10, my minimum e = 1, decipher = 10
mes = 11, cipher = 11, my minimum e = 1, decipher = 11
mes = 12, cipher = 12, my minimum e = 1, decipher = 12
mes = 13, cipher = 19, my minimum e = 7, decipher = 13
mes = 14, cipher = 5, my minimum e = 7, decipher = 14
mes = 15, cipher = 9, my minimum e = 2, decipher = 15
mes = 16, cipher = 4, my minimum e = 2, decipher = 16
mes = 17, cipher = 29, my minimum e = 7, decipher = 17
mes = 18, cipher = 24, my minimum e = 7, decipher = 18
mes = 19, cipher = 28, my minimum e = 7, decipher = 19
mes = 20, cipher = 14, my minimum e = 7, decipher = 20
mes = 21, cipher = 21, my minimum e = 1, decipher = 21
mes = 22, cipher = 22, my minimum e = 1, decipher = 22
mes = 23, cipher = 23, my minimum e = 1, decipher = 23
mes = 24, cipher = 30, my minimum e = 7, decipher = 24
mes = 25, cipher = 16, my minimum e = 2, decipher = 25
mes = 26, cipher = 20, my minimum e = 7, decipher = 26
mes = 27, cipher = 15, my minimum e = 2, decipher = 27
mes = 28, cipher = 7, my minimum e = 7, decipher = 28
mes = 29, cipher = 2, my minimum e = 7, decipher = 29
mes = 30, cipher = 6, my minimum e = 7, decipher = 30
mes = 31, cipher = 25, my minimum e = 2, decipher = 31
mes = 32, cipher = 32, my minimum e = 1, decipher = 32
Это то что делал некоторое время назад.
Вижу здесь тоже обсуждают RSA, вот решил запостить, может кому-то будет интересно.