Skip to main content

Posts

Showing posts with the label C# code for encription and decription of password or text

C Sharp code for encription and decription of password or text

C# code of encription and decription following are two functions. one for encryption and second for decryption. textbox3 is text box to input data and textbox4 is textbox shows encrypted data. private void encrypt() { int i = 0; string result = ""; string old = textBox3.Text; do { result = result + Convert.ToChar(Convert.ToInt32(old) + (i + 2)); i = i + 1; } while (i < old.Length); textBox4.Text = result; textBox3.Text =""; } private void decrypt() { int i = 0; string result = ""; string old = textBox4.Text; do { result = result + Convert.ToChar(Convert.ToInt32(old) - (i + 2)); i = i + 1; } while (i < old.Length); textBox3.Text = result; textBox4,Text=""; }