コード例 #1
0
ファイル: Biff8DecryptingStream.cs プロジェクト: okevin/chama
        public Biff8DecryptingStream(Stream in1, int InitialOffSet, Biff8EncryptionKey key)
        {
            _rc4 = new Biff8RC4(InitialOffSet, key);

            if (in1 is ILittleEndianInput)
            {
                // accessing directly is an optimisation
                _le = (ILittleEndianInput)in1;
            }
            else
            {
                // less optimal, but should work OK just the same. Often occurs in junit tests.
                _le = new LittleEndianInputStream(in1);
            }
        }
コード例 #2
0
ファイル: Biff8RC4.cs プロジェクト: okevin/chama
 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;
 }