Beispiel #1
0
        public virtual void DecryptAsync(string inputFile, string outputFile)
        {
            IAsyncResult res         = null;
            var          cfDelegate  = new CryptFunctionDelegate(this.Crypt);
            var          syncCurrent = SynchronizationContext.Current;

            res = cfDelegate.BeginInvoke(inputFile, outputFile, false, delegate
            {
                syncCurrent.Send(delegate
                {
                    var cryprres = cfDelegate.EndInvoke(res);
                    if (DecryptComplitedEvent != null)
                    {
                        DecryptComplitedEvent(cryprres, Password);
                    }
                }, null);
            }, null);
        }
Beispiel #2
0
 public virtual void EncryptAsync(string inputFile, string outputFile)
 {
     IAsyncResult res = null;
     var syncCurrent = SynchronizationContext.Current;
     var cfDelegate = new CryptFunctionDelegate(this.Crypt);
     res = cfDelegate.BeginInvoke(inputFile, outputFile, true, delegate
     {
         syncCurrent.Send(delegate
         {
             var cryprres = cfDelegate.EndInvoke(res);
             if (EncryptComplitedEvent != null)
                 EncryptComplitedEvent(cryprres, Password);
         }, null);
     }, null);
 }
Beispiel #3
0
 /// <summary>
 /// Создание экземпляра
 /// </summary>
 /// <param name="BlockLenth">Длина блока</param>
 /// <param name="rounds">Количество иттераций</param>
 public FeistelNetwork(byte BlockLenth, byte rounds)
 {
     this.BlockLenth = BlockLenth;
     this.Rounds     = rounds;
     cfDelegate      = new CryptFunctionDelegate(this.Crypt);
 }
 /// <summary>
 /// Создание экземпляра
 /// </summary>
 /// <param name="BlockLenth">Длина блока</param>
 /// <param name="rounds">Количество иттераций</param>
 public FeistelNetwork(byte BlockLenth, byte rounds)
 {
     this.BlockLenth = BlockLenth;
     this.Rounds = rounds;
     cfDelegate = new CryptFunctionDelegate(this.Crypt);
 }