using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Security.Cryptography; using System.IO;
namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
// string to byte byte[] source = Encoding.Unicode.GetBytes(textBox1.Text);
// select Triple DES service provider TripleDESCryptoServiceProvider des = new TripleDESCryptoServiceProvider();
// make to write stream MemoryStream ms = new MemoryStream(); CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(DesKey, DesIV), CryptoStreamMode.Write);
//write data Encrypte cs.Write(source, 0, source.Length); cs.Close();
//get to byte from string byte[] destination = ms.ToArray(); ms.Close();
//show this textBox2.Text = Encoding.Unicode.GetString(destination);