How to Encrypt and Decrypt in C#

  1. private void button1_Click(object sender, EventArgs e)  
  2. {  
  3.    textBox2.Text = Convert.ToBase64String(Encoding.Unicode.GetBytes(textBox1.Text));  
  4.    textBox1.BackColor = System.Drawing.Color.Yellow;  
  5. }  
  6. private void button2_Click(object sender, EventArgs e)  
  7. {  
  8.    textBox3.Text = Encoding.Unicode.GetString(Convert.FromBase64String(textBox2.Text));  
  9.    textBox3.BackColor = System.Drawing.Color.Yellow;  
  10. }