예제 #1
0
        public TripleDESCng(CngProvider algorithmProvider)
        {
            if (algorithmProvider == null)
                throw new ArgumentNullException("algorithmProvider");

            m_symmetricAlgorithm = new BCryptSymmetricAlgorithm(new CngAlgorithm(BCryptNative.AlgorithmName.TripleDes),
                                                                algorithmProvider,
                                                                LegalBlockSizesValue,
                                                                LegalKeySizesValue);

            // Propigate the default properties from the TripleDES class to the implementation algorithm.
            m_symmetricAlgorithm.BlockSize = BlockSizeValue;
            m_symmetricAlgorithm.KeySize = KeySizeValue;
            m_symmetricAlgorithm.Mode = ModeValue;
            m_symmetricAlgorithm.Padding = PaddingValue;
        }
예제 #2
0
        public AesCng(CngProvider algorithmProvider)
        {
            if (algorithmProvider == null)
            {
                throw new ArgumentNullException("algorithmProvider");
            }

            m_symmetricAlgorithm = new BCryptSymmetricAlgorithm(new CngAlgorithm(BCryptNative.AlgorithmName.Aes),
                                                                algorithmProvider,
                                                                LegalBlockSizesValue,
                                                                LegalKeySizesValue);

            // Propigate the default properties from the Aes class to the implementation algorithm.
            m_symmetricAlgorithm.BlockSize = BlockSizeValue;
            m_symmetricAlgorithm.KeySize   = KeySizeValue;
            m_symmetricAlgorithm.Mode      = ModeValue;
            m_symmetricAlgorithm.Padding   = PaddingValue;
        }