Exemple #1
0
 // ECB mode decryption
 private int EcbDecrypt(byte[] input, int inputOffset, int inputCount, byte[] output, int outputOffset)
 {
     if (inputCount < cipherBytes)
     {
         return(0);
     }
     GetBytes(input, inputOffset, block, cipherBytes);
     cipher.Decrypt(block, block);
     PutBytes(block, output, outputOffset, cipherBytes);
     return(cipherBytes);
 }
Exemple #2
0
        // ECB mode decryption
        int EcbDecrypt(byte[] input, int inputOffset, int inputCount, byte[] output, int outputOffset)
        {
            if (inputCount >= _cipherBytes)
            {
                GetBytes(input, inputOffset, _block, _cipherBytes);
                _cipher.Decrypt(_block, _block);
                PutBytes(_block, output, outputOffset, _cipherBytes);

                return(_cipherBytes);
            }

            return(0);
        }