diff --git a/BBEncryptionCracker/src/de/mrbesen/GenTestEncryption.java b/BBEncryptionCracker/src/de/mrbesen/GenTestEncryption.java new file mode 100644 index 0000000..c2dc422 --- /dev/null +++ b/BBEncryptionCracker/src/de/mrbesen/GenTestEncryption.java @@ -0,0 +1,35 @@ +package de.mrbesen; + +import java.util.Random; + +public class GenTestEncryption { + + public static void main(String[] args) { + long max = 50000; + long a, b, c, d, M, v, e, n; + + Random rand = new Random(); + a = rand.nextLong() % max; + b = rand.nextLong() % max; + c = rand.nextLong() % max; + d = rand.nextLong() % max; + + + //positive only + a = (a > 0 ? a : -a); + b = (b > 0 ? b : -b); + c = (c > 0 ? c : -c); + d = (d > 0 ? d : -d); + + M = (a*b)-1; + v = (c*M) +a; + e = (d*M) +b; + n = (v*e)-1 / M; + + System.out.println("e: " + e + "\nv: " + v + "\nn: " + n); + + if((v*e) % n == 1) { + System.out.println("Schlüßel gültig!"); + } + } +} \ No newline at end of file