File tree 1 file changed +8
-7
lines changed
scripts/python/encryption
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
1
from rich import print
2
2
from string import ascii_uppercase
3
3
4
- # Note: This is still in progress!
5
-
6
4
7
5
def main () -> None :
6
+ print (create_cipher_map ("COLLEGE" ))
7
+
8
8
print (encrypt ("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z" , "KRYPTOS" ))
9
+ print (encrypt ("UNIVERSITY" , "COLLEGE" )) # UMFVGRSFTY
9
10
print (encrypt ("Knowledge is Power" , "KRYPTOS" )) # IlmWjbaEb GQ NmWbp
10
11
print (encrypt ("zljeft dtOT" , "secret" )) # ZOMBIE HERE
11
12
@@ -23,11 +24,11 @@ def encrypt(plain_text: str, keyword: str) -> str:
23
24
24
25
25
26
def create_cipher_map (keyword : str ) -> str :
26
- output = str ( set ( keyword . upper ()))
27
- for char in ascii_uppercase :
28
- if not char in keyword :
29
- output += char
30
- return output
27
+ cipher_map = []
28
+ for char in ( keyword . upper () + ascii_uppercase ) :
29
+ if not char in cipher_map :
30
+ cipher_map . append ( char )
31
+ return cipher_map
31
32
32
33
33
34
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments