public static byte[] encrypt(byte[] data, byte[] key) {
        if(data.length == 0) {
            return data;
        }

        int[] s = Util.bytesToInts(data);
        int[] g = Util.bytesToInts(Arrays.copyOfRange(key, 0, 16));

        int d = s.length;
        int j = s[d - 1], l = s[0];
        int o = 0x9E3779B9;

        int m, i, a = (int) Math.floor(6 + 52 / d);
        int h = 0;
        for(; a > 0; a--) {
            h += o;
            i = h >>> 2 & 3;
            for(int b = 0; b < d; b++) {
                l = s[(b + 1) % d];
                m = (j >>> 5 ^ l << 2) + (l >>> 3 ^ j << 4) ^ (h ^ l) + (g[b & 3 ^ i] ^ j);
                j = s[b] += m;
            }
        }

        return Util.intsToBytes(s);
    }