-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDecypt.java
More file actions
33 lines (26 loc) · 766 Bytes
/
Copy pathDecypt.java
File metadata and controls
33 lines (26 loc) · 766 Bytes
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
/* Raynier Leroux
* Decriptor for Caesar Cipher
*/
public class Decypt extends Encript{
public static String Decryption(String Encrypted, String Shift) {
int Shif = Integer.parseInt(Shift);
System.out.println(Shif);
String solved = "";
System.out.println("Shift: " + Shift);
System.out.println(Encrypted.length());
// Encript.shift
for (int i = 0; i < Encrypted.length(); i++) {
char C = Encrypted.toUpperCase().charAt(i);
if(C == ' ' ) {
System.out.print(" ");
solved += C;
} // END IF
else {
C = (char)(((int)C - Shif + 65) % 26 + 65);
System.out.print(C);
solved += C;
} // END Else
} // End For
return solved;
} // End of Method
} // End of file