public EncryptingValueConverter(
     IValueConverter decoratedValueConverter,
     IEncryptionAlgorithmFactory encryptionAlgorithmFactory)
 {
     _decoratedValueConverter = decoratedValueConverter;
     _encryptionAlgorithm = encryptionAlgorithmFactory.GetAlgorithm(decoratedValueConverter.Type);
 }
Exemple #2
0
 public EncryptingValueConverter(
     IValueConverter decoratedValueConverter,
     IEncryptionAlgorithmFactory encryptionAlgorithmFactory)
 {
     _decoratedValueConverter = decoratedValueConverter;
     _encryptionAlgorithm     = encryptionAlgorithmFactory.GetAlgorithm(decoratedValueConverter.Type);
 }
            public void SetUp()
            {
                _rijndaelAlgo  = new RijndaelAlgorithm();
                _tripleDesAlgo = new TripleDesAlgorithm();

                _keyFactoryRijndael  = new EncryptionKeyIvFactory(new RijndaelAlgorithm());
                _keyFactoryTripleDes = new EncryptionKeyIvFactory(new TripleDesAlgorithm());
            }
        public IServiceBusConfigurationBuilder AddEnryptionAlgorithm(IEncryptionAlgorithm algorithm)
        {
            Guard.AgainstNull(algorithm, "algorithm");

            configuration.AddEncryptionAlgorithm(algorithm);

            return this;
        }
Exemple #5
0
 public CryptoService(ICryptoStore store, IHashAlgorithm hashAlgorithm, 
     IEncryptionAlgorithm encryptionAlgorithm, IUserBasedDataProtection userBasedDataProtection)
 {
     _store = store;
     _hashAlgorithm = hashAlgorithm;
     _encryptionAlgorithm = encryptionAlgorithm;
     _userBasedDataProtection = userBasedDataProtection;
 }
Exemple #6
0
        public DefaultConfigurator AddEnryptionAlgorithm(IEncryptionAlgorithm algorithm)
        {
            Guard.AgainstNull(algorithm, "algorithm");

            _configuration.AddEncryptionAlgorithm(algorithm);

            return(this);
        }
        public ServiceBusConfigurator AddEnryptionAlgorithm(IEncryptionAlgorithm algorithm)
        {
            Guard.AgainstNull(algorithm, "algorithm");

            configuration.AddEncryptionAlgorithm(algorithm);

            return(this);
        }
        public DefaultConfigurator AddEnryptionAlgorithm(IEncryptionAlgorithm algorithm)
        {
            Guard.AgainstNull(algorithm, "algorithm");

            _configuration.AddEncryptionAlgorithm(algorithm);

            return this;
        }
 private void btnEncrypt_Click(object sender, EventArgs e)
 {
     InputText = txtEncryptInputContent.Text;
     Key       = txtKey.Text;
     if (string.IsNullOrEmpty(InputText) || string.IsNullOrEmpty(Key))
     {
         MessageBox.Show("Şifrelemek için metin ve anahtar girmek zorunludur.");
         return;
     }
     algorithm = new VigenereCipher(InputText, Key);
     txtEncryptOutContent.Text = algorithm.Encrypt();
 }
Exemple #10
0
        public void SetAlgorithm(Algorithm alGore)
        {
            switch (alGore)
            {
            case Algorithm.ROT13:
                encryptor = new ROT13();
                break;

            case Algorithm.StringReverse:
                encryptor = new StringReverse();
                break;
            }
        }
Exemple #11
0
        public HillTests()
        {
            matrix = new int[3, 3];

            matrix[0, 0] = 17;
            matrix[0, 1] = 21;
            matrix[0, 2] = 2;

            matrix[1, 0] = 17;
            matrix[1, 1] = 18;
            matrix[1, 2] = 2;

            matrix[2, 0] = 5;
            matrix[2, 1] = 21;
            matrix[2, 2] = 19;

            _target = new Hill(matrix);
        }
Exemple #12
0
        public static IEncryptionAlgorithm Create(EncryptionAlgorithm algoType)
        {
            IEncryptionAlgorithm encryptionInstance = null;

            switch (algoType)
            {
            case EncryptionAlgorithm.AES:
                encryptionInstance = new Encryption.AES();
                break;

            case EncryptionAlgorithm.Rijndael:
                encryptionInstance = new Encryption.Rijndael();
                break;

            default:
                throw new Exception("Incorrect use of EncryptionAlgoritm factory");
            }
            return(encryptionInstance);
        }
Exemple #13
0
 protected EncryptionService CreateSut(IEncryptionAlgorithm algorithm, EncryptionKeyIv key)
 {
     return(new EncryptionService(algorithm, key));
 }
        static void ExecutePlugin(IEncryptionAlgorithm algorithm)
        {
            ConsoleEncrypter consoleEncrypter = new ConsoleEncrypter(algorithm);

            consoleEncrypter.GetAndEncryptInput();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ByteDev.Crypto.Encryption.EncryptionService" /> class.
 /// </summary>
 /// <param name="encryptionAlgorithm">Encryption algorithm to use when encrypting and decrypting.</param>
 /// <param name="keyIv">The key and initialization vector to use when encrypting and decrypting.</param>
 /// <exception cref="T:System.ArgumentNullException"><paramref name="encryptionAlgorithm" /> is null.</exception>
 /// <exception cref="T:System.ArgumentNullException"><paramref name="keyIv" /> is null.</exception>
 public EncryptionService(IEncryptionAlgorithm encryptionAlgorithm, EncryptionKeyIv keyIv)
 {
     _encryptionAlgorithm = encryptionAlgorithm ?? throw new ArgumentNullException(nameof(encryptionAlgorithm));
     _keyIv          = keyIv ?? throw new ArgumentNullException(nameof(keyIv));
     _encoderFactory = new EncoderFactory();
 }
 public Decrypter(IEncryptionAlgorithm cipher, IKeyring keyring)
 {
     _cipher  = cipher;
     _keyring = keyring;
 }
Exemple #17
0
 public ConsoleEncrypter(IEncryptionAlgorithm encryptionAlgorithm)
 {
     this.encryptionAlgorithm = encryptionAlgorithm;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ByteDev.Crypto.Encryption.KeyIv.EncryptionKeyIvFactory" /> class.
 /// </summary>
 /// <param name="algorithm">Algorithm to use when encrypting.</param>
 public EncryptionKeyIvFactory(IEncryptionAlgorithm algorithm)
 {
     _algorithm = algorithm;
 }
Exemple #19
0
 public RailFenceTests()
 {
     _target = new RailFence(2);
 }
        public void AddEncryptionAlgorithm(IEncryptionAlgorithm algorithm)
        {
            Guard.AgainstNull(algorithm, "algorithm");

            _encryptionAlgorithms.Add(algorithm);
        }
 public Aes256CbcHmacSha256Provider(IKeyring keyring, IEncryptionAlgorithm cipher)
 {
     _keyring = keyring;
     _cipher  = cipher;
 }
Exemple #22
0
 public CeaserTests()
 {
     _target = new Ceaser(3);
 }
Exemple #23
0
 public AutpService(IEncryptionAlgorithm encryptionAlgorithm)
 {
     this.encryptionAlgorithm = encryptionAlgorithm;
 }
Exemple #24
0
 public EncryptionService()
 {
     _encryptionAlgorithm = new DefaultEncryptionAlgorithm();
 }
 public Encrypter(IEncryptionAlgorithm cipher, IKey key)
 {
     _cipher = cipher;
     _key    = key;
 }
Exemple #26
0
        public void AddEncryptionAlgorithm(IEncryptionAlgorithm algorithm)
        {
            Guard.AgainstNull(algorithm, nameof(algorithm));

            _encryptionAlgorithms.Add(algorithm);
        }
Exemple #27
0
 public LegacyRsaDecrypter(IKeyring keyring, IEncryptionAlgorithm cipher)
 {
     _keyring = keyring;
     _cipher  = cipher;
 }
 public AeadAes256CbcHmacSha512Provider(IEncryptionAlgorithm cipher, IKeyring keyring)
 {
     _cipher  = cipher;
     _keyring = keyring;
 }
 public PlayFairTests()
 {
     _target = new PlayFair("playfairexample");
 }
        public void AddEncryptionAlgorithm(IEncryptionAlgorithm algorithm)
        {
            Guard.AgainstNull(algorithm, "algorithm");

            encryptionAlgorithms.Add(algorithm);
        }
Exemple #31
0
 public RowTranspositionTests()
 {
     _target = new RowTransposition(new int[] { 4, 3, 1, 2, 5, 6, 7 });
 }
Exemple #32
0
 public EncryptionService(IEncryptionAlgorithm encryptionAlgorithm)
 {
     _encryptionAlgorithm = encryptionAlgorithm;
 }