Professional Documents
Culture Documents
University of Sumer College of Computer Science and Information Technology Dept. Computer Science/ Fourth Class
University of Sumer College of Computer Science and Information Technology Dept. Computer Science/ Fourth Class
Technology
Course Title
1
Encryption and Decryption for Simple vigenere Cipher Method
Theory
2
Fig.: Simple Vigenere Cipher method Components.
3
codes for Encryption Simple Vigenere Cipher
Next
End If
For i = 1 To t1
m = Mid(TextBox1.Text, i, 1)
a = Asc(m)
kk = Mid(TextBox2.Text, i, 1)
k = Asc(kk)
If (a >= 65) And (a <= 90) Then
k2 = k - 65
Else
k2 = k - 97
End If Encryption
If (a >= 65) And (a <= 90) Then
x = a - 65
y = x + k2
z = y Mod 26
x2 = z + 65
Else
x = a - 97
y = x + k2
z = y Mod 26
x2 = z + 97
End If
c = Chr(x2)
sum = sum + c
Next
TextBox3.Text = sum
End Sub
4
For i = 1 To Len(TextBox3.Text)
m = Mid(TextBox3.Text, i, 1)
a = Asc(m)
kk = Mid(TextBox2.Text, i, 1)
k = Asc(kk)
If (k > 65) And (k <= 90) Then
k2 = k - 65
Else
k2 = k - 97
End If
If (a >= 65) And (a <= 90) Then
x3 = a - 65
Else
x = x3
End If
y = x - k2
z = y Mod 26
x2 = z + 97
End If
c = Chr(x2)
sum = sum + c
Next
TextBox4.Text = sum
End Sub
End Class
5
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles
Button3.Click
TextBox1.Clear()
Clear
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
End Sub
End
end
End Sub