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); }
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); }
/// <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); }