|
@ -13,6 +13,38 @@ public class ITsecAufgaben { |
|
|
boolean an = true; |
|
|
boolean an = true; |
|
|
int N = 0, phiOfN = 0, decKey = 0, C1 = 0, encKey = 0, abbrechen = 0; |
|
|
int N = 0, phiOfN = 0, decKey = 0, C1 = 0, encKey = 0, abbrechen = 0; |
|
|
|
|
|
|
|
|
|
|
|
Scanner in = new Scanner(System.in); |
|
|
|
|
|
|
|
|
|
|
|
while (an) { |
|
|
|
|
|
|
|
|
|
|
|
System.out.println("Abbrechen & Lösungen anzeigen mit '1', ansonsten weiter "); |
|
|
|
|
|
abbrechen = in.nextInt(); |
|
|
|
|
|
if (abbrechen == 1) { |
|
|
|
|
|
an = false; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
System.out.println( |
|
|
|
|
|
"Ergebnisse für N, phiOfN, decKey, Cipher1 & encKey eingeben:\n Vorsicht: encKey besteht aus N & '?' angehangen ; alle Werte sind integer"); |
|
|
|
|
|
System.out.println("N:"); |
|
|
|
|
|
N = in.nextInt(); |
|
|
|
|
|
System.out.println("phiOfN:"); |
|
|
|
|
|
phiOfN = in.nextInt(); |
|
|
|
|
|
System.out.println("decKey:"); |
|
|
|
|
|
decKey = in.nextInt(); |
|
|
|
|
|
System.out.println("C1:"); |
|
|
|
|
|
C1 = in.nextInt(); |
|
|
|
|
|
System.out.println("encKey:"); |
|
|
|
|
|
encKey = in.nextInt(); |
|
|
|
|
|
|
|
|
|
|
|
if (N == 221 && phiOfN == 192 && encKey == 22111 && decKey == 35 && C1 == 56) { |
|
|
|
|
|
System.out.println("\nRichtiges Ergebnis\n"); |
|
|
|
|
|
an = false; |
|
|
|
|
|
} else { |
|
|
|
|
|
System.out.println("\nFalsches Ergebnis\n"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|