Esempio n. 1
0
        private void setDecryptor(int cryptoFlag)
        {
            int aux = cryptoFlag & 0xFF;

            switch (aux)
            {
            case 0x01:
                dec = new NoCrypt();
                Debug.WriteLine("MODE: Decryption Algorithm NONE");
                break;

            case 0x02:
                dec = new AESCBC128Decrypt();
                Debug.WriteLine("MODE: Decryption Algorithm AESCBC128");
                break;

            default:
                throw new Exception("Crypto mode is not valid: Undefined decryptor");
            }
        }
Esempio n. 2
0
        private void setDecryptor(int cryptoFlag)
        {
            int aux = cryptoFlag & 0xFF;
            switch (aux) {
                case 0x01:
                    dec = new NoCrypt();
                    Debug.WriteLine("MODE: Decryption Algorithm NONE");
                    break;
                case 0x02:
                    dec = new AESCBC128Decrypt();
                    Debug.WriteLine("MODE: Decryption Algorithm AESCBC128");
                    break;
                default:
                    throw new Exception("Crypto mode is not valid: Undefined decryptor");

            }
        }