Пример #1
0
        private void setDecryptor(int cryptoFlag)
        {
            switch ((cryptoFlag & 0xff))
            {
            case 1:
                this.dec = new NoCrypt();
                Debug.WriteLine("MODE: Encrypting Algorithm NONE");
                break;

            case 2:
                this.dec = new AESCBC128Encrypt();
                Debug.WriteLine("MODE: Encrypting Algorithm AESCBC128");
                break;

            default:
                throw new Exception("Crypto mode is not valid: Undefined decryptor");
            }
        }
        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");
            }
//            if ((cryptoFlag & 0x0F000000) != 0) cryptoDebug = true;
        }
Пример #3
0
        private void setDecryptor(int cryptoFlag)
        {
            switch ((cryptoFlag & 0xff))
            {
                case 1:
                    this.dec = new NoCrypt();
                    Debug.WriteLine("MODE: Encrypting Algorithm NONE");
                    break;

                case 2:
                    this.dec = new AESCBC128Encrypt();
                    Debug.WriteLine("MODE: Encrypting Algorithm AESCBC128");
                    break;

                default:
                    throw new Exception("Crypto mode is not valid: Undefined decryptor");
            }
        }