예제 #1
0
        public byte[] DecodeEBC(byte[] bloks)
        {
            ExpandData(ref bloks);
            var result = new List <byte>();

            for (int i = 0; i < bloks.Length; i += _algorithm.Size())
            {
                result.AddRange(_algorithm.DecodeBlok(bloks.Skip(i).Take(_algorithm.Size()).ToArray()));
            }
            original_text = result;
            return(result.ToArray());
        }
예제 #2
0
        public byte[] Decode(byte[] bloks)
        {
            var m = new List <byte>();

            for (int i = 0; i < bloks.Length; i += _algorithm.Size)
            {
                m.AddRange(_algorithm.DecodeBlok(bloks.Skip(i).Take(_algorithm.Size).ToArray()));
            }

            return(m.ToArray());
        }
예제 #3
0
파일: CFB.cs 프로젝트: heyW0rld/Crypto
        public byte[] Decode(byte[] code)
        {
            var c = (byte[])code.Clone();
            var m = new List <byte>();

            byte[] prev = _c0;
            for (int i = 0; i < code.Length; i += _algorithm.Size)
            {
                m.AddRange(_algorithm.DecodeBlok(prev));
                for (int j = 0; j < _algorithm.Size; j++)
                {
                    m[i + j] ^= c[i + j];
                }

                prev = c.Skip(i).Take(_algorithm.Size).ToArray();
            }

            return(m.ToArray());
        }