コード例 #1
0
        public void StartEncrypt()
        {
            Block b;

            while ((b = io.getNextBlock()) != null)
            {
                io.writeBlock(Kripsi.Encrypt(b, key));
            }
        }
コード例 #2
0
        public void StartDecrypt()
        {
            Block antrian;
            Block k;
            byte? Cstream;
            byte  C;
            byte  P;

            antrian = GenerateIV(key);
            while ((Cstream = io.getNextByte()) != null)
            {
                k = Kripsi.Encrypt(antrian, key);

                C = Cstream.Value;
                P = (byte)(C ^ k[0]);
                antrian.RemoveAt(0);
                antrian.Add(k[0]);
                io.writeByte(P);
            }
        }
コード例 #3
0
        public void StartEncrypt()
        {
            Block antrian;
            Block k;
            byte? Pstream;
            byte  P;
            byte  C;

            antrian = GenerateIV(key);
            while ((Pstream = io.getNextByte()) != null)
            {
                k = Kripsi.Encrypt(antrian, key);

                P = Pstream.Value;
                C = (byte)(P ^ k[0]);
                antrian.RemoveAt(0);
                antrian.Add(C);
                io.writeByte(C);
            }
        }
コード例 #4
0
        public void StartEncrypt()
        {
            Block P;
            Block C;

            P = io.getNextBlock();
            if (P != null)
            {
                C = Kripsi.Encrypt(Kripsi.XOR(P, IV), key);
                //Console.WriteLine("P = " + P);
                //Console.WriteLine("K = " + key);
                //Console.WriteLine("C = " + C);
                io.writeBlock(C);
                while ((P = io.getNextBlock()) != null)
                {
                    C = Kripsi.Encrypt(Kripsi.XOR(P, C), key);
                    io.writeBlock(C);
                    //Console.WriteLine("C = " + C);
                }
            }
        }