encryptutil field cleanup

This commit is contained in:
Sen 2025-05-30 21:14:35 +02:00
parent ec0a1aa5c3
commit 228eec0a79
Signed by: sen
GPG key ID: 3AC50A6F47D1B722

View file

@ -34,6 +34,9 @@ import javax.crypto.spec.SecretKeySpec;
import common.log.Log; import common.log.Log;
public class EncryptUtil { public class EncryptUtil {
private static final long CRC24_INIT = 0xB704CEL;
private static final long CRC24_POLY = 0x1864CFBL;
public static SecretKey createSharedKey() { public static SecretKey createSharedKey() {
try { try {
KeyGenerator keygen = KeyGenerator.getInstance("AES"); KeyGenerator keygen = KeyGenerator.getInstance("AES");
@ -191,10 +194,6 @@ public class EncryptUtil {
return new Pair<PublicKey, String>(pubkey, tok.length == 4 ? tok[3] : null); return new Pair<PublicKey, String>(pubkey, tok.length == 4 ? tok[3] : null);
} }
private static final long CRC24_INIT = 0xB704CEL;
private static final long CRC24_POLY = 0x1864CFBL;
private static final byte[] CLIENT_SALT = "ItIsSaltySalt2765666 tftffs ##89n!.le98udMeowHAsh44m;+*3m9DI9Sqn".getBytes();
private static byte[] crc24(byte[] data) { private static byte[] crc24(byte[] data) {
long crc = CRC24_INIT; long crc = CRC24_INIT;
for(byte bt : data) { for(byte bt : data) {