-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
101 lines (82 loc) · 4.38 KB
/
Main.java
File metadata and controls
101 lines (82 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import Classes.*;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import java.io.IOException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("FXMLFiles/StartMenu.fxml"));
primaryStage.setTitle("CipherChef");
primaryStage.setScene(new Scene(root));
primaryStage.show();
primaryStage.setResizable(false);
}
public static void main(String[] args) throws NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, UnsupportedAudioFileException, IOException, LineUnavailableException {
/*
Monoalphabetic mono = new Monoalphabetic();
mono.setInput("Litwo Ojczyzno moja Ty jesteś jak zdrowie Ile cię stracił Dziś piękność twą w szlacheckim stanie trudno zaradzić wolał gości Żydom do nowej mody odsyłać konie porzucone same szczypiąc trawę ciągnęły powoli pod lasem zwaliska");
mono.decrypt();
mono.displayTextLettersFrequency();
//Playfair playfair = new Playfair("jebac telewizje polska jacek kurski chuj ci w dziaslo", "marcin");
Playfair playfair = new Playfair("cfhbe yltbyficf ugkthr mrelt tsixsm ioqm ia z fxmrtkkZ", "marcin");
//playfair.displayMatrix();
playfair.decrypt();
//playfair.encrypt();
System.out.print(playfair.getOutput());
*/
//Vigener vigener = new Vigener("tajny tekst","klucz");
// Vigener vigener = new Vigener("ATTACKATDAWN","lemon");
// vigener.encrypt();
//Vigener vigener = new Vigener("dldpxdpeus","klucz");
//Vigener vigener = new Vigener("LXFOPVEFRNHR","LEMONLEMONLE");
// vigener.displayMatrix();
//vigener.decrypt();
// System.out.println("getOutput() " + vigener.getOutput());
//launch(args);
// MorseCode morseCode = new MorseCode("sos jednostka uszkodzona N 21 5 W 78 7 niedaleko Karaibów sos");
// morseCode.encrypt();
//MorseCode morseCode = new MorseCode("... --- ... / .--- . -.. -. --- ... - -.- .- / ..- ... --.. -.- --- -.. --.. --- -. .- / -. / ..--- .---- / ..... / .-- / --... ---.. / --... / -. .. . -.. .- .-.. . -.- --- / -.- .- .-. .- .. -... --- .-- / / ... --- ... ");
//morseCode.decrypt();
//morseCode.soundMorseCode("... --- ... / ... --- ... ");
//morseCode.soundMorseCode(morseCode.getOutput());
// System.out.println("getOutput() " + morseCode.getOutput());
//RSA rsa = new RSA("polska gorom 321 aaaa");// on koduje rsa ale dziala jak podstawieniowy wiec niebezpoieczny a teraz w nocy znalazlem ze sa metody jakies w java rsa
//rsa.stringToNumbers("elo");
//rsa.encrypt();
//System.out.println("getOutput() " + rsa.getOutput());
/*Homophonic homophonic = new Homophonic();
//homophonic.setInput("dziala");
//homophonic.encrypt();
homophonic.setInput("166126103210");
homophonic.decrypt();
System.out.println(homophonic.getOutput());
AES ecb = new AES("CBC");
ecb.setInputString("Twój stary najebany na wersalce");
ecb.setKeyString("thisisa128bitkey");
//ecb.generateIv();
ecb.setIv("RKA2IpuGQlBJAez6276obQ==");
System.out.println(ecb.getIvString());
//ecb.encrypt();
//System.out.println(ecb.getOutputString());
ecb.setInputString("KIGeBzGI8YGfqNL3YDge5omW52A9dO6g3IuKkjyzN/r0GmsgkHjuSCGhPN6VZlQ4");
ecb.decrypt();
//System.out.println(ecb.getOutputString());
//System.out.println(ecb.getKeyString());*/
//morseCode.soundMorseCode("... --- ... / .--- . -.. -. --- ... - -.- .- ");
// ElGamal elGamal = new ElGamal("abca",11);
// elGamal.encrypt();
// System.out.println(elGamal.getOutput());
launch(args);
}
}