Skip to content

Commit

Permalink
adf
Browse files Browse the repository at this point in the history
  • Loading branch information
FLCN17 committed Jun 1, 2018
1 parent 0f3cdfe commit 587e2e0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
Empty file.
54 changes: 27 additions & 27 deletions ADFGVXCipher/ENCRYPTCHART.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
z,
y,
n,
q,
t,
9,
5,
r,
x,
j,
b,
h,
k,
e,
g,
l,
f,
o,
p,
4,
h,
1,
b,
j,
c,
8,
f,
w,
6,
7,
d,
m,
s,
7,
v,
u,
o,
2,
3,
c,
z,
l,
5,
a,
1,
g,
q,
4,
0,
d,
u,
9,
r,
x,
i,
k,
w,
8,
0
m,
3,
n,
2
12 changes: 7 additions & 5 deletions ADFGVXCipher/src/ADFGVXCipher.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public static void main(String[] args) throws IOException {
Chart codeChart = null;
Scanner keyboard = new Scanner(System.in);
PrintWriter chartFile = new PrintWriter("ENCRYPTCHART.txt");
String codeDigits = "", message, phrase, cipherText = "", newChart = "", chartFileLoc;
String codeDigits = "", message, phrase, newChart = "", chartFileLoc;
String[] cipherText = null;
boolean validInput = false;
//encryption or decryption
do {
Expand Down Expand Up @@ -54,18 +55,19 @@ public static void main(String[] args) throws IOException {
}

//System.out.print(codeDigits.charAt(0) == 65);
System.out.printf("%s", cipherText);
for(int i = 0; i < cipherText.length; i++)
System.out.printf("%s", cipherText[i]);

keyboard.close();
}

public static String Encryption(String clearText, String secretPhrase, Chart codeChart) {
String cipherText = "", sortedPhrase = "";
public static String[] Encryption(String clearText, String secretPhrase, Chart codeChart) {
String[] cipherText = new String[clearText.length()], sortedPhrase = new String[clearText.length()];
//strip whitespace
clearText.replace(" ", "");
//get Cartesian coords
for(int i = 0; i < clearText.length(); i++)
cipherText += codeChart.CodeReturn(clearText.toLowerCase().charAt(i));
cipherText[i] = codeChart.CodeReturn(clearText.toLowerCase().charAt(i));
//perform phrase sorting


Expand Down

0 comments on commit 587e2e0

Please sign in to comment.