public void StartDecrypt()
        {
            Block b;

            while ((b = io.getNextBlock()) != null)
            {
                io.writeBlock(Kripsi.Decrypt(b, key));
            }
        }
Example #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);
            }
        }
Example #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);
            }
        }
        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);
                }
            }
        }
        public void StartDecrypt()
        {
            Block P;
            Block C;
            Block CBef;   // Block C sebelumnya

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