コード例 #1
0
ファイル: crypto.cs プロジェクト: wolewd/Windows-Server-2003
        private static ICryptoTransform GetCryptoTransform(bool fEncrypt)
        {
            InterlockedStack st = (fEncrypt ? s_oEncryptorStack : s_oDecryptorStack);
            ICryptoTransform ct = (st.Pop() as ICryptoTransform);

            if (null == ct)
            {
                ct = NewCryptTransform(fEncrypt);
            }
            return(ct);
        }
コード例 #2
0
ファイル: crypto.cs プロジェクト: wolewd/Windows-Server-2003
        private static void ConfigureEncryptionObject()
        {
            lock (s_initLock) {
                if (null == s_oDes)
                {
                    s_oEncryptorStack = new InterlockedStack();
                    s_oDecryptorStack = new InterlockedStack();
                    s_oHashAlgoStack  = new InterlockedStack();

                    DESCryptoServiceProvider des = new DESCryptoServiceProvider();
                    des.GenerateKey();
                    des.GenerateIV();
                    s_oDes = des;
                }
            }
        }
コード例 #3
0
ファイル: crypto.cs プロジェクト: wolewd/Windows-Server-2003
        private static void ReturnCryptoTransform(bool fEncrypt, ICryptoTransform ct)
        {
            InterlockedStack st = (fEncrypt ? s_oEncryptorStack : s_oDecryptorStack);

            st.Push(ct);
        }