Remove redundant cipher

This commit is contained in:
Bruno Rybársky 2024-04-08 12:34:10 +02:00
parent 1b21099378
commit 1c0dd64566

@ -36,9 +36,8 @@ public class SecureChat implements ClientModInitializer {
cipher.init(Cipher.ENCRYPT_MODE, Config.HANDLER.instance().getRawKey(), Config.HANDLER.instance().getRawIv());
String strippedMessage = message_content.replace("®", "");
byte[] decodedMessage = ChatCoder.decodeFromBmp(strippedMessage);
Cipher decryptingCipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
decryptingCipher.update(decodedMessage);
String decryptedMessage = new String(decryptingCipher.doFinal());
cipher.update(decodedMessage);
String decryptedMessage = new String(cipher.doFinal());
String outputMessage = "{" + player_name + "} " + decryptedMessage;
MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(Text.of(outputMessage));
return false;