mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
parent
7ad308cc23
commit
dfa2b042e4
1 changed files with 3 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue