Repository navigation
Expand file tree
/
Copy pathleet3.sh
More file actions
160 lines (145 loc) · 4.06 KB
/
Copy pathleet3.sh
File metadata and controls
160 lines (145 loc) · 4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
# Leetspeak Simple für Termux mit Groß-/Kleinschreibung
# Encoder und Decoder in einem
# Farben für die Ausgabe
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Encoder-Funktion mit Groß-/Kleinschreibung
encode_text() {
local text="$1"
# Zuerst Kleinbuchstaben ersetzen
text=$(echo "$text" | sed \
-e 's/a/4/g' \
-e 's/e/3/g' \
-e 's/l/1/g' \
-e 's/o/0/g' \
-e 's/t/7/g' \
-e 's/s/5/g' \
-e 's/z/2/g' \
-e 's/h/#/g' \
-e 's/i/!/g' \
-e 's/g/6/g' \
-e 's/q/9/g' \
-e 's/c/(/g' \
-e 's/x/*/g')
# Dann Großbuchstaben ersetzen
text=$(echo "$text" | sed \
-e 's/A/4/g' \
-e 's/E/3/g' \
-e 's/L/1/g' \
-e 's/O/0/g' \
-e 's/T/7/g' \
-e 's/S/5/g' \
-e 's/Z/2/g' \
-e 's/H/#/g' \
-e 's/I/!/g' \
-e 's/G/6/g' \
-e 's/Q/9/g' \
-e 's/C/(/g' \
-e 's/X/*/g')
echo "$text"
}
# Decoder-Funktion mit Groß-/Kleinschreibung
decode_text() {
local text="$1"
# Leetspeak zu Kleinbuchstaben
text=$(echo "$text" | sed \
-e 's/4/a/g' \
-e 's/3/e/g' \
-e 's/1/l/g' \
-e 's/0/o/g' \
-e 's/7/t/g' \
-e 's/5/s/g' \
-e 's/2/z/g' \
-e 's/#/h/g' \
-e 's/!/i/g' \
-e 's/6/g/g' \
-e 's/9/q/g' \
-e 's/(/c/g' \
-e 's/*/x/g')
# Leetspeak zu Großbuchstaben
text=$(echo "$text" | sed \
-e 's/4/A/g' \
-e 's/3/E/g' \
-e 's/1/L/g' \
-e 's/0/O/g' \
-e 's/7/T/g' \
-e 's/5/S/g' \
-e 's/2/Z/g' \
-e 's/#/H/g' \
-e 's/!/I/g' \
-e 's/6/G/g' \
-e 's/9/Q/g' \
-e 's/(/C/g' \
-e 's/*/X/g')
echo "$text"
}
show_header() {
clear
echo -e "${GREEN}"
echo "╔══════════════════════════════════╗"
echo "║ LEETSPEAK CONVERTER ║"
echo "║ mit Groß-/Kleinschreibung ║"
echo "╚══════════════════════════════════╝"
echo -e "${NC}"
}
# Hauptmenü
while true; do
show_header
echo -e "${YELLOW}Wähle einen Modus:${NC}"
echo "1) Text zu Leetspeak kodieren"
echo "2) Leetspeak zu Text dekodieren"
echo "3) Beenden"
echo
echo -e "${BLUE}Leetspeak-Tabelle:${NC}"
echo "a/A=4 e/E=3 l/L=1 o/O=0 t/T=7"
echo "s/S=5 z/Z=2 h/H=# i/I=! g/G=6"
echo "q/Q=9 c/C=( x/X=*"
echo
read -p "Auswahl (1-3): " choice
case $choice in
1)
while true; do
show_header
echo -e "${BLUE}===== KODIERMODUS =====${NC}"
echo "Gib Text ein (leere Zeile für Menü):"
echo
read -r input
if [ -z "$input" ]; then
break
fi
result=$(encode_text "$input")
echo -e "${GREEN}Kodiert: $result${NC}"
echo
read -p "Drücke Enter für nächste Eingabe..."
done
;;
2)
while true; do
show_header
echo -e "${BLUE}===== DEKODIERMODUS =====${NC}"
echo "Gib Leetspeak ein (leere Zeile für Menü):"
echo
read -r input
if [ -z "$input" ]; then
break
fi
result=$(decode_text "$input")
echo -e "${GREEN}Dekodiert: $result${NC}"
echo
read -p "Drücke Enter für nächste Eingabe..."
done
;;
3)
echo -e "${YELLOW}Auf Wiedersehen!${NC}"
exit 0
;;
*)
echo -e "${RED}Ungültige Auswahl!${NC}"
sleep 2
;;
esac
done