Skip to content

Instantly share code, notes, and snippets.

@ecki ecki/DLog.java
Created Aug 19, 2015

Embed
What would you like to do?
Testing @DLogBot
package test;
import java.math.BigInteger;
public class DLog
{
// testing @DLogBot http://crypto.2015.rump.cr.yp.to/e7803fa1f87ce2a18dbbbbcffc8d5695.pdf
public static void main(String[] args)
{
BigInteger apache = b("9fdb8b8a004544f0045f1737d0ba2e0b274cdf1a9f588218fb435316a16e374171fd19d8d8f37c39bf863fd60e3e300680a3030c6e4c3757d08f70e6aa871033");
BigInteger modssl = b("d4bcd52406f69b35994b88de5db89682c8157f62d8f33633ee5772f11f05ab22d6b5145b9f241e5acc31ff090a4bc71148976f76795094e71e7903529f5a824b");
BigInteger openssl = b("da583c16d9852289d0e4af756f4cca92dd4be533b804fb0fed94ef9c8a4403ed574650d36999db29d776276ba2d3d412e218f4dd1e084cf6d8003e7c4774e833");
System.out.println("a " + b("2").modPow(b("0102030405060708FFFFFFFFFFFFFFFF"), apache).toString(16));
System.out.println("m " + b("2").modPow(b("0102030405060708FFFFFFFFFFFFFFFF"), modssl).toString(16));
System.out.println("o " + b("2").modPow(b("0102030405060708FFFFFFFFFFFFFFFF"), openssl).toString(16));
}
public static BigInteger b(String hex)
{
return new BigInteger(hex, 16);
}
}
https://twitter.com/eckes/status/633889906457190400
eckes @eckes:
@DLogBot a 8dc0b9e968a841e8e98619527323b39d7a1dfcefd2f9ed95525b55b3b5cc49520e0d187b8773959de4e72516726d9c41220dcfedeac979b4aaa23c2aa3204877
8:35am · 19 Aug 2015
CA Services @DLogBot
@eckes 102030405060708ffffffffffffffff
8:36am · 19 Aug 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.