Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var token = textBox1.Text.Trim();
            var data  = richTextBox1.Text;

            var requestEncrypter = new RequestEncrypterRijndael(token);

            richTextBox2.Text = requestEncrypter.encryptString(data);
        }
Example #2
0
        public void encryptRequest_objectRecieved_encryptAndDecrypAreEqual()
        {
            var tokenizer    = getTokenizer(TimeSpan.FromHours(6));
            var token        = getToken(tokenizer, new DummyUserIdentityMovil("DRCD"));
            var data         = "data to encrypt";
            var encrypter    = new RequestEncrypterRijndael(token);
            var decrypter    = new RequestEncrypterRijndael(token);
            var dataEncryted = encrypter.encryptString(data);
            var dataDecrypt  = decrypter.decryptString(dataEncryted);

            Assert.IsTrue(dataDecrypt.Equals(data));
        }