From 005613b8eefefa1ddc80d4ff87ca2ba2d14081b1 Mon Sep 17 00:00:00 2001 From: aybuk04 Date: Wed, 25 Sep 2024 15:16:32 +0300 Subject: [PATCH] fixed java --- Cipher.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cipher.java b/Cipher.java index 938d060..9ac91f4 100644 --- a/Cipher.java +++ b/Cipher.java @@ -16,7 +16,7 @@ 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); } return outputString; @@ -28,10 +28,10 @@ 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++) { // append the encrypted version of the char to the output string - outputString += replaceChar(inputString.charAt(i), false); + outputString += replaceChar(inputString.charAt(v), false); } return outputString; @@ -48,7 +48,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); } } }