public byte[] Encrypt(byte[] data) { if (data.Length != 8) { throw new Exception("Data size must be 8 bytes"); } ICryptoTransform encryptor = des.CreateWeakEncryptor(mKey, IV, 0); return(encryptor.TransformFinalBlock(data, 0, data.Length)); }