Hallo Leute!
Ich arbeite gerade an einem Text-Verschlüsselungs-Programm. Dazu möchte ich einen Verschlüsselungs-Algorhythmus erstellen, indem jemand den Text schreibt und darunter ein Passwort eingibt, nach dem der Text verschlüsselt wird. Dazu hatte ich die Idee, dass halt, wenn z.B.
Also ist meine Frage, ob es überhaupt klug ist nach diesem Muster vorzugehen, und wenn ja, wie denn der mögliche code aussehen könnte, wobei die einzelnen zeichen des Passworts gelesen und demnach Verschlüsselt werden.
Hier nochmal mein aktuelles Skript:
Spoiler anzeigen
achja und button1 ist der butten, der wenn ich etwas in textbox1 eingegeben habe, den text verschlüsselt.
Edit by Manschula: Überlanger Codeausschnitt in Expander gepackt
Ich arbeite gerade an einem Text-Verschlüsselungs-Programm. Dazu möchte ich einen Verschlüsselungs-Algorhythmus erstellen, indem jemand den Text schreibt und darunter ein Passwort eingibt, nach dem der Text verschlüsselt wird. Dazu hatte ich die Idee, dass halt, wenn z.B.
Also ist meine Frage, ob es überhaupt klug ist nach diesem Muster vorzugehen, und wenn ja, wie denn der mögliche code aussehen könnte, wobei die einzelnen zeichen des Passworts gelesen und demnach Verschlüsselt werden.
Hier nochmal mein aktuelles Skript:
VB.NET-Quellcode
- Public Class Form1
- Dim X As String = "", _
- V As String = ""
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim str As String, Newstr As String = Nothing
- str = TextBox1.Text
- For Each StrText As String In str
- Select Case True
- 'chars
- Case StrText = "a"
- StrText = "c"
- Case StrText = "b"
- StrText = "d"
- Case StrText = "c"
- StrText = "e"
- Case StrText = "d"
- StrText = "f"
- Case StrText = "e"
- StrText = "g"
- Case StrText = "f"
- StrText = "h"
- Case StrText = "g"
- StrText = "i"
- Case StrText = "h"
- StrText = "j"
- Case StrText = "i"
- StrText = "k"
- Case StrText = "j"
- StrText = "l"
- Case StrText = "k"
- StrText = "m"
- Case StrText = "l"
- StrText = "n"
- Case StrText = "m"
- StrText = "o"
- Case StrText = "n"
- StrText = "p"
- Case StrText = "o"
- StrText = "q"
- Case StrText = "p"
- StrText = "r"
- Case StrText = "q"
- StrText = "s"
- Case StrText = "r"
- StrText = "t"
- Case StrText = "s"
- StrText = "u"
- Case StrText = "t"
- StrText = "v"
- Case StrText = "u"
- StrText = "w"
- Case StrText = "v"
- StrText = "x"
- Case StrText = "w"
- StrText = "y"
- Case StrText = "x"
- StrText = "z"
- Case StrText = "y"
- StrText = "a"
- Case StrText = "z"
- StrText = "b"
- 'nums
- Case StrText = "1"
- StrText = "3"
- Case StrText = "2"
- StrText = "4"
- Case StrText = "3"
- StrText = "5"
- Case StrText = "4"
- StrText = "6"
- Case StrText = "5"
- StrText = "7"
- Case StrText = "6"
- StrText = "8"
- Case StrText = "7"
- StrText = "9"
- Case StrText = "8"
- StrText = "0"
- Case StrText = "9"
- StrText = "1"
- Case StrText = "0"
- StrText = "2"
- 'UPER CASE
- Case StrText = "A"
- StrText = "C"
- Case StrText = "B"
- StrText = "D"
- Case StrText = "C"
- StrText = "E"
- Case StrText = "D"
- StrText = "F"
- Case StrText = "E"
- StrText = "G"
- Case StrText = "F"
- StrText = "H"
- Case StrText = "G"
- StrText = "I"
- Case StrText = "H"
- StrText = "J"
- Case StrText = "I"
- StrText = "K"
- Case StrText = "J"
- StrText = "L"
- Case StrText = "K"
- StrText = "M"
- Case StrText = "L"
- StrText = "N"
- Case StrText = "M"
- StrText = "O"
- Case StrText = "N"
- StrText = "P"
- Case StrText = "O"
- StrText = "Q"
- Case StrText = "P"
- StrText = "R"
- Case StrText = "Q"
- StrText = "S"
- Case StrText = "R"
- StrText = "T"
- Case StrText = "S"
- StrText = "U"
- Case StrText = "T"
- StrText = "V"
- Case StrText = "U"
- StrText = "W"
- Case StrText = "V"
- StrText = "X"
- Case StrText = "W"
- StrText = "Y"
- Case StrText = "X"
- StrText = "Z"
- Case StrText = "Y"
- StrText = "A"
- Case StrText = "Z"
- StrText = "B"
- 'Secial Char
- Case StrText = "½"
- StrText = "#"
- Case StrText = "!"
- StrText = "¤"
- Case StrText = "#"
- StrText = "%"
- Case StrText = "¤"
- StrText = "&"
- Case StrText = "%"
- StrText = "/"
- Case StrText = "&"
- StrText = "("
- Case StrText = "/"
- StrText = ")"
- Case StrText = "("
- StrText = "="
- Case StrText = ")"
- StrText = "?"
- Case StrText = "="
- StrText = "`"
- Case StrText = "?"
- StrText = "^"
- Case StrText = "`"
- StrText = "*"
- Case StrText = "^"
- StrText = ">"
- Case StrText = "*"
- StrText = ","
- Case StrText = ">"
- StrText = "."
- Case StrText = ","
- StrText = "-"
- Case StrText = "."
- StrText = "§"
- Case StrText = "-"
- StrText = "@"
- Case StrText = "§"
- StrText = "£"
- Case StrText = "@"
- StrText = "$"
- Case StrText = "£"
- StrText = "€"
- Case StrText = "$"
- StrText = "{"
- Case StrText = "€"
- StrText = "["
- Case StrText = "{"
- StrText = "]"
- Case StrText = "["
- StrText = "}"
- Case StrText = "]"
- StrText = "\"
- Case StrText = "}"
- StrText = "´"
- Case StrText = "\"
- StrText = "¨"
- Case StrText = "´"
- StrText = "'"
- Case StrText = "¨"
- StrText = "<"
- Case StrText = "~"
- StrText = ";"
- Case StrText = "<"
- StrText = ":"
- Case StrText = ";"
- StrText = "_"
- Case StrText = ":"
- StrText = "|"
- Case StrText = "_"
- StrText = "½"
- Case StrText = "|"
- StrText = "!"
- Case True
- For I = 0 To X.Length - 1
- StrText = StrText.Replace(V.ElementAt(I), _
- X.ElementAt(I))
- Next
- End Select
- Newstr &= StrText
- Next
- TextBox1.Text = Newstr
- End Sub
- Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
- End Sub
- End Class
achja und button1 ist der butten, der wenn ich etwas in textbox1 eingegeben habe, den text verschlüsselt.
Edit by Manschula: Überlanger Codeausschnitt in Expander gepackt
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „Manschula“ ()