Rename ~2887 unreadable Procyon-decompiler locals/params (f/f2/fN, n/n2, bl/bl2, nArray, bufferedImage, etc.) across 169 files to context-aware camelCase identifiers (x, y, width, height, alpha, color, sensitivity, etc.). Logic, control flow, field/method names and method signatures (types/arity) are preserved; only local variable and parameter names changed. Co-Authored-By: Claude Opus 4.7 <[email protected]>
32 lines
844 B
Java
32 lines
844 B
Java
package shit.zen.utils;
|
|
|
|
import java.security.SecureRandom;
|
|
import java.util.Arrays;
|
|
|
|
public class ByteCipher {
|
|
private final byte[] key;
|
|
|
|
public ByteCipher(byte[] keyBytes) {
|
|
this.key = Arrays.copyOf(keyBytes, keyBytes.length);
|
|
}
|
|
|
|
public byte[] encrypt(byte[] input, int shift) {
|
|
byte[] output = new byte[input.length];
|
|
for (int i = 0; i < input.length; ++i) {
|
|
output[i] = (byte)(input[i] + this.key[i % this.key.length] + shift);
|
|
}
|
|
return output;
|
|
}
|
|
|
|
public byte[] decrypt(byte[] input, int shift) {
|
|
byte[] output = new byte[input.length];
|
|
for (int i = 0; i < input.length; ++i) {
|
|
output[i] = (byte)(input[i] - this.key[i % this.key.length] - shift);
|
|
}
|
|
return output;
|
|
}
|
|
|
|
static {
|
|
new SecureRandom();
|
|
}
|
|
} |