42 lines
1.9 KiB
Python
42 lines
1.9 KiB
Python
|
#!/usr/bin/env nix-shell
|
||
|
#!nix-shell -i python3 -p python3
|
||
|
|
||
|
# Character mapping table:
|
||
|
#
|
||
|
# 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
|
||
|
# +----------------------------------------------------
|
||
|
# A | 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
|
||
|
# B | 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 A
|
||
|
# C | C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
|
||
|
# D | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
|
||
|
# E | E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
|
||
|
# F | F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
|
||
|
# G | G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
|
||
|
# H | H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
|
||
|
# I | I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
|
||
|
# J | J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
|
||
|
# K | K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
|
||
|
# L | L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
|
||
|
# M | M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
|
||
|
# N | N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
|
||
|
# O | O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
|
||
|
# P | P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
|
||
|
# Q | Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
|
||
|
# R | R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
|
||
|
# S | S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
|
||
|
# T | T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
|
||
|
# U | U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
|
||
|
# V | V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
|
||
|
# W | W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
|
||
|
# X | X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
|
||
|
# Y | Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
|
||
|
# Z | Z 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
|
||
|
|
||
|
enc = "UFJKXQZQUNB"
|
||
|
key = "SOLVECRYPTO"
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
for (x, y) in zip(enc, key):
|
||
|
decrypted = chr(((((ord(x) - ord('A')) - (ord(y) - ord('A'))) + 26) % 26) + ord('A'))
|
||
|
print(decrypted, end="")
|