import webcrypt.crypto.*; import java.math.BigInteger; /** * A little program to try and crack my ElGamal ciphertext. */ public class CrackMyElGamal{ public static void main(String[] args) throws KeyCreationException{ String lines_one_ten_eleven_twenty = "4326568080913930914584881328713824717739019142533337100129825246978414238175271514587481645411624670846303928225545978654616316800993232071535103981576501640964353626158389133267646230297626819579287977655912649710947732557480780404600117244\n" +"3804268042095436538291398509836307713630403517085024484607544546326719674031957356183833130241829856672938832707351918193770525824378968250649213127235435215117351431793360948475890888063286827345344096383386244382538970709973233477150886568\n" +"3922088887587563286410191469364326376046580115713710368343024870128319600582563684165750300497154738961285495942417889130891030080980000911157387853683515905780392950853144882193727386477360793181243630984372694120040970581279826306883696701\n" +"4500589805185217787802656802946775513265665911256181700043709201057557660575492619567022939909143704383205242756950128996727092293342738734525888463594804459919194966609489173420856267117140964847313508799855545384442851840270701210209481274\n"; //10 seconds before timestamp -- 2003_8_3_23_59_56 long begintime = 1059969596000L; //10 seconds after timestamp -- 2003_8_4_0_0_16 long endtime = 1059969616000L; //JVM had a maximum resolution of 10 milliseconds, //so only check values divisible by 10 //RUNNING TIME: At about one check every 5 seconds, and 2000 times to check //running time is about 3 hours. ElGamal ker = new ElGamal(); for(long t = begintime; t<= endtime; t+=10){ StringBuffer sb = new StringBuffer(lines_one_ten_eleven_twenty); ElGamalKey key = new ElGamalKey("GENERATE_!"+t); ker.decryptOn(sb,key); System.out.println("seed = "+t+":"); System.out.println(sb.toString()); } } }