Exemple #1
0
 public Biff8RC4(int InitialOffset, Biff8EncryptionKey key)
 {
     if (InitialOffset >= RC4_REKEYING_INTERVAL)
     {
         throw new Exception("InitialOffset (" + InitialOffset + ")>"
                 + RC4_REKEYING_INTERVAL + " not supported yet");
     }
     _key = key;
     _streamPos = 0;
     RekeyForNextBlock();
     _streamPos = InitialOffset;
     for (int i = InitialOffset; i > 0; i--)
     {
         _rc4.Output();
     }
     _shouldSkipEncryptionOnCurrentRecord = false;
 }
 public RecordInputStream(Stream in1, Biff8EncryptionKey key, int initialOffset)
 {
     if (key == null)
     {
         _dataInput = SimpleHeaderInput.GetLEI(in1);
         _bhi = new SimpleHeaderInput(in1);
     }
     else
     {
         Biff8DecryptingStream bds = new Biff8DecryptingStream(in1, initialOffset, key);
         _bhi = bds;
         _dataInput = bds;
     }
     _nextSid = ReadNextSid();
 }