Ejemplo n.º 1
0
        private byte[] EncryptRX(byte[] Key, byte[] Data)
        {
            int blocks = Data.Length / 16;

            byte[] outputData = new byte[Data.Length];

            RDX transform = new RDX();

            transform.Init(true, Key);

            for (int i = 0; i < blocks; i++)
            {
                transform.EncryptBlock(Data, i * 16, outputData, i * 16);
            }

            return(outputData);
        }
Ejemplo n.º 2
0
        private byte[] EncryptRDX(byte[] Key, byte[] Vector, byte[] Data)
        {
            int blocks = Data.Length / 16;

            byte[] outputData = new byte[Data.Length];

            RDX         transform = new RDX();
            ICipherMode cipher    = new CBC(transform);

            cipher.Init(true, new KeyParams(Key, Vector));

            for (int i = 0; i < blocks; i++)
            {
                cipher.Transform(Data, i * 16, outputData, i * 16);
            }

            return(outputData);
        }
Ejemplo n.º 3
0
        private byte[] EncryptRDX(byte[] Key, byte[] Vector, byte[] Data)
        {
            int blocks = Data.Length / 16;
            byte[] outputData = new byte[Data.Length];

            RDX transform = new RDX();
            ICipherMode cipher = new CBC(transform);
            cipher.Init(true, new KeyParams(Key, Vector));

            for (int i = 0; i < blocks; i++)
                cipher.Transform(Data, i * 16, outputData, i * 16);

            return outputData;
        }
Ejemplo n.º 4
0
        private byte[] DecryptRX(byte[] Key, byte[] Data)
        {
            int blocks = Data.Length / 16;
            byte[] outputData = new byte[Data.Length];

            RDX transform = new RDX();
            transform.Init(false, Key);

            for (int i = 0; i < blocks; i++)
                transform.DecryptBlock(Data, i * 16, outputData, i * 16);

            return outputData;
        }