Exemplo n.º 1
0
 /// <summary>
 /// 构造新的DES流
 /// </summary>
 /// <param name="inputReader">待加密/解密输入流</param>
 /// <param name="inputKey">密钥</param>
 /// <param name="inputWriter">结果输出流</param>
 /// <param name="inputIV">初始向量,解密时不需要提供</param>
 public DESStream(BinaryReader inputReader, Bitset inputKey, BinaryWriter inputWriter, Bitset inputIV = null)
 {
     reader = inputReader;
     writer = inputWriter;
     key    = inputKey;
     DES    = new DESAlgorithm();
     if (inputIV != null)
     {
         IV = inputIV;
     }
     else
     {
         IV = new Bitset(64);
     }
 }