I am trying to run a java code for a Vigenere cipher.
When running the code I get an error for file not found. The code is:
Vignere.java
package vigeneregui;
import java.util.Scanner;
/**
* @author AnupamGenius
*/
public class Vigenere {
private String EnDekey;
public Vigenere(String key) {
setKey(key);
}
public void setKey(String key) {
if (key == null) {
this.EnDekey = "";
return;
}
char[] digit = key.toUpperCase().toCharArray();
StringBuilder sb = new StringBuilder(digit.length);
for (char c : digit) {
if (c >= 'A' && c <= 'Z') sb.append(c);
}
this.EnDekey = sb.toString();
}
/**
* Encode a message according to the key already registered
*/
public String Encrypt(String clear) {
// ignore if null
if (clear == null)
return "";
// ignore if key length == 0
if (EnDekey.length() == 0)
return clear.toUpperCase();
char[] String_digits = clear.toLowerCase().toCharArray(); // build a string with the repeated key at least the size of our message
String Key_Long = EnDekey;
while (Key_Long.length() < clear.length())
Key_Long += EnDekey;
for (int i = 0; i < String_digits.length; i++) {
if (String_digits[i] < 'a' || String_digits[i] > 'z')
continue;
char offset = Key_Long.charAt(i);
int nbShift = offset - 'A';
String_digits[i] = Character
Error
C:\Users\Student\Documents\Security Exercise 1>"C:\Program Files\Java\jdk-12.0.2\bin"\javac E1Code1.java
error:file not found: E1Code.java
E1Code
is in the Security Exercise 1 directory.