Example #1
0
    public int encrypt(byte[] raw, int offset, int size)
    {
        // reserve checksum
        size += 4;

        if (_static)

        {
            // reserve for XOR "key"
            size += 4;

            // padding
            size += 8 - (size % 8);
            NewCrypt.encXORPass(raw, offset, size, rnd.Next());
            _staticCrypt.crypt(raw, offset, size);

            _static = false;
        }
        else

        {
            // padding
            size += 8 - (size % 8);
            NewCrypt.appendChecksum(raw, offset, size);
            _crypt.crypt(raw, offset, size);
        }
        return(size);
    }
Example #2
0
 public static void appendChecksum(byte[] raw)
 {
     NewCrypt.appendChecksum(raw, 0, raw.Length);
 }