public Biff8DecryptingStream(Stream in1, int InitialOffSet, Biff8EncryptionKey key)
        {
            _rc4 = new Biff8RC4(InitialOffSet, key);

            if (in1 is LittleEndianInput)
            {
                // accessing directly is an optimisation
                _le = (LittleEndianInput)in1;
            }
            else
            {
                // less optimal, but should work OK just the same. Often occurs in junit tests.
                _le = new LittleEndianInputStream(in1);
            }
        }
Ejemplo n.º 2
0
        public Biff8DecryptingStream(Stream in1, int InitialOffSet, Biff8EncryptionKey key)
        {
            _rc4 = new Biff8RC4(InitialOffSet, key);

            if (in1 is LittleEndianInput)
            {
                // accessing directly is an optimisation
                _le = (LittleEndianInput)in1;
            }
            else
            {
                // less optimal, but should work OK just the same. Often occurs in junit tests.
                _le = new LittleEndianInputStream(in1);
            }
        }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
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;
 }