示例#1
0
        public FileChipherer(ChiphererAlgo algo, byte[] key)
        {
            switch (algo)
            {
            case ChiphererAlgo.AES:
                chipherer = new AES(key);
                break;

            case ChiphererAlgo.Kalyna:
                chipherer = new Kalyna(key);
                break;

            default:
                return;
            }
        }
示例#2
0
        public FileChipherer(ChiphererAlgo algo, byte[] key)
        {
            switch (algo)
            {
            case ChiphererAlgo.AES_ECB:
                chipherer = new AESmodeECB(key);
                break;

            case ChiphererAlgo.RC4:
                chipherer = new RC4(key);
                break;

            default:
                return;
            }
        }
示例#3
0
        public FileChipherer(ChiphererAlgo algo)
        {
            switch (algo)
            {
            case ChiphererAlgo.AES_ECB:
                chipherer = new AESmodeECB(Encoding.ASCII.GetBytes("aaaabbbbccccdddd"));
                break;

            case ChiphererAlgo.AES_CBC:
                chipherer = new AESmodeCBC(Encoding.ASCII.GetBytes("aaaabbbbccccdddd"), Encoding.ASCII.GetBytes("oooooooooooooooo"));
                break;

            case ChiphererAlgo.AES_CFB:
                chipherer = new AESmodeCFB(Encoding.ASCII.GetBytes("aaaabbbbccccdddd"), Encoding.ASCII.GetBytes("oooooooooooooooo"));
                break;

            case ChiphererAlgo.AES_OFB:
                chipherer = new AESmodeOFB(Encoding.ASCII.GetBytes("aaaabbbbccccdddd"), Encoding.ASCII.GetBytes("oooooooooooooooo"));
                break;

            case ChiphererAlgo.AES_CTR:
                chipherer = new AESmodeCTR(Encoding.ASCII.GetBytes("aaaabbbbccccdddd"), Encoding.ASCII.GetBytes("oooooooooooooooo"));
                break;

            case ChiphererAlgo.RC4:
                chipherer = new RC4(Encoding.ASCII.GetBytes("aaaaaaaabbbbbbbbccccccccdddddddd"));
                break;

            case ChiphererAlgo.Salsa20:
                chipherer = new Salsa20(Encoding.ASCII.GetBytes("aaaaaaaabbbbbbbbccccccccdddddddd"), new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 });
                break;

            default:
                return;
            }
        }