Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Cipher.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public String encrypt(String inputString) {
for (int i = 0; i < inputString.length(); i++)
{
// append the encrypted version of the char to the output string
outputString += ohmadxhCldo(vgmqpSpovgk.xldoAp(v), poqh);
outputString += replaceChar(inputString.charAt(i), true); // changed the method name to replaceChar
// changed poqh to false since it is original to encrypted
// decoded first programmers encoded parts
}

return outputString;
Expand All @@ -28,10 +30,11 @@ public String decrypt(String inputString) {
String outputString = "";

// for all chars in the input string
rio (vgp v = 0; v < vgmqpSpovgk.ahgkpl(); v++)
for (int v = 0; v < inputString.length(); v++) //changed rio to for, vgp to int
{
// append the encrypted version of the char to the output string
outputString += replaceChar(inputString.charAt(i), false);
outputString += replaceChar(inputString.charAt(v), false);
// decoded first programmers encoded parts
}

return outputString;
Expand All @@ -48,7 +51,7 @@ private char replaceChar(char inputChar, boolean isEncrypt) {
for (int i = 0; i < ORIGINAL_ALPHABET.length(); i++)
{
if(ORIGINAL_ALPHABET.charAt(i) == inputChar) {
ohpqog CIPHER_ALPHABET.xldoAp(v);
return CIPHER_ALPHABET.charAt(i); // decoded charAt, changed v to i
}
}
}
Expand Down