예제 #1
0
        static void Main(string[] args)
        {
            byte[] a = { 0x19, 0xa0, 0x9a, 0xe9, 0x3d, 0xf4, 0xc6, 0xf8, 0xe3, 0xe2, 0x8d, 0x48, 0xbe, 0x2b, 0x2a, 0x08 };
            //String a = "asdaughtirtfk\vdrt4444111211";
            blmat text = new blmat(a);

            //Console.WriteLine(text.retblmatstr());
            text.generateRKeyList();
            text.Crypt();
            text.deCrypt();
            //Console.WriteLine(text.retblmatstr());

            Console.Read();
        }
예제 #2
0
        static void Main(string[] args)
        {
            byte[] a = { 0x19, 0xa0, 0x9a, 0xe9, 0x3d, 0xf4, 0xc6, 0xf8, 0xe3, 0xe2, 0x8d, 0x48, 0xbe, 0x2b, 0x2a, 0x08 };
            //String a = "asdaughtirtfk\vdrt4444111211";
            blmat text = new blmat(a);

            //Console.WriteLine(text.retblmatstr());
            text.generateRKeyList();
            text.Crypt();
            text.deCrypt();
            //Console.WriteLine(text.retblmatstr());

            Console.Read();
        }
예제 #3
0
        private BigInteger decryptU(BigInteger Krec, byte[] Ukrec)
        {
            blmat aes = new blmat(Ukrec);
            aes.acceptKeyStr(Krec.ToString());
            aes.generateRKeyList();
            aes.deCrypt();

            BigInteger U = new BigInteger(aes.retblmatstr(), 10);
            //Console.WriteLine("\nU': " + U);

            return U;
        }
예제 #4
0
        private byte[] cryptU(BigInteger d, BigInteger Km)
        {
            String s = d.ToString();

            blmat aes = new blmat(s);
            aes.acceptKeyStr(Km.ToString());
            aes.generateRKeyList();
            aes.Crypt();

            byte[] Uk = aes.retblmatbyte();
            //Console.WriteLine("\nUk: " + Uk);

            return Uk;
        }