Exemplo n.º 1
0
        public Crypto()
        {
            KeyHandler keyhandler = new KeyHandler();
            var key = keyhandler.GetKeys();
            var vector = keyhandler.GetVector();

            //This is our encryption method
            RijndaelManaged rm = new RijndaelManaged();

            //Create an encryptor and a decryptor using our encryption method, key, and vector.
            _encryptorTransform = rm.CreateEncryptor(key, vector);
            _decryptorTransform = rm.CreateDecryptor(key, vector);

            //Used to translate bytes to text and vice versa
            _utfEncoder = new UTF8Encoding();
        }