Hoi
Meine Lösung aus den guten alten VB.net Zeiten xD
Code:
Public Class caesar
Public Shared Function rot(ByVal input As String, ByVal key As Integer) As String
rot = ""
For i = 0 To input.Length - 1
Dim tmp As Int32 = Asc(input.Substring(i, 1))
If tmp >= 97 And tmp <= 122 Then
tmp += key
If tmp > 122 Then
tmp -= 26
End If
rot += Chr(tmp)
ElseIf tmp >= 65 And tmp <= 90
tmp += key
If tmp > 90 Then
tmp -= 26
End If
rot += Chr(tmp)
Else
rot += Chr(tmp)
End If
Next
End Function
Public Shared Function brute(ByVal input As String) As List(Of String)
brute = New List(Of String)
For key = 1 To 26
brute.Add(rot(input, key))
Next
End Function
End Class