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); }
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); }
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; }
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; }