From dfa2b042e4f63cc5246c6a45f620238ee7980305 Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Wed, 21 Jul 2021 19:14:57 +0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=9F=D1=80=D0=BE=D0=B1=D0=BB=D0=B5?= =?UTF-8?q?=D0=BC=D1=8B=20=D1=81=20=D0=BA=D0=BE=D0=B4=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=BE=D0=B9=20=D0=B2=20SecurityHelper=20Closes=20#?= =?UTF-8?q?412?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/pro/gravit/utils/helper/SecurityHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/SecurityHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/SecurityHelper.java index b64dc069..26dfe32a 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/SecurityHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/SecurityHelper.java @@ -488,12 +488,12 @@ public static Cipher newRSAEncryptCipher(RSAPublicKey publicKey) { //AES public static byte[] encrypt(String seed, byte[] cleartext) throws Exception { - byte[] rawKey = getAESKey(seed.getBytes()); + byte[] rawKey = getAESKey(IOHelper.encode(seed)); return encrypt(rawKey, cleartext); } public static byte[] encrypt(String seed, String cleartext) throws Exception { - return encrypt(seed, cleartext.getBytes()); + return encrypt(seed, IOHelper.encode(cleartext)); } public static byte[] getAESKey(byte[] seed) throws Exception { @@ -520,7 +520,7 @@ public static byte[] decrypt(byte[] raw, byte[] encrypted) throws Exception { } public static byte[] decrypt(String seed, byte[] encrypted) throws Exception { - return decrypt(getAESKey(seed.getBytes()), encrypted); + return decrypt(getAESKey(IOHelper.encode(seed)), encrypted); } public static byte[] fromHex(String hexString) {