I can not get the encrption to work with this code.
It is suppose to take in a word from the user and encrypt it based on the substitution string in the code.
CODE
Public Class EncryptionForm
' using the substitution cipher
Private Sub SubstitutionCipher()
' normal alphabet String
Dim normalAlphabet As String = _
"abcdefghijklmnopqrstuvwxyz .!?,"
' substitution alphabet String
Dim cipherAlphabet As String = _
"cdefg.hijk!lmn opqr?stuv,wxyzab"
Dim index1 As Integer ' index variable for For...Next loop
Dim index2 As Integer ' inner index variable
Dim plain As String = plainTextBox.Text ' String entered by the user
Dim cipher As String ' encrypted String
cipherTextLabel.Text = "" ' clear output TextBox
plain = plain.ToLower() ' make characters lowercase
For index1 = 1 To plain.Length 'go through user input string
For index2 = 1 To plain.Length ' go through the cipher alphabet string the length of the input string
cipher &= cipherAlphabet.Chars(index2) ' append character to string
Next
cipherTextLabel.Text = cipher ' output new string to label
Next
End Sub ' SubstitutionCipher