-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdodoCrypt.py
More file actions
58 lines (40 loc) · 1.26 KB
/
dodoCrypt.py
File metadata and controls
58 lines (40 loc) · 1.26 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
# Verscchluesselungsarray schreiben
ascii = 65
a = chr(ascii)
y = []
for i in range(26):
ip = chr(i + 65)
x = []
for p in range(26):
if i+p+65 <= 90:
x.append(chr(i+p+65))
else:
x.append(chr(i+p+65-26))
y.append(x)
# Frage Key
key = raw_input('Gib bitte die Spalte an: \n')
# Frage text
text = raw_input('Gib bitte die Zeile an: \n')
# Jeder Buchstabe des Keys ist =q
#for currentkeychar in key:
#print q
#Mit dem ersten Buchstaben aus dem Text
# Textstelle bekommt den Wer null
textstelle = 0
for w in text:
#print w
arraystelle = 0
#Suche in der Spalte nach dem Keybuchstaben mit selben Index
for n in y[0]:
if n == w:
#print wrong
#l = 0
keystelle = 0
while keystelle != 25:
if y[keystelle][arraystelle] == key[textstelle]:
#print wrong2
print y[keystelle][0]
keystelle += 1
#l += 1
arraystelle += 1
textstelle += 1