We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 005fb0c commit 5b72d5eCopy full SHA for 5b72d5e
ciphers/brute-force_caesar_cipher.py
@@ -0,0 +1,18 @@
1
+message = input("Encrypted message: ")
2
+LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
3
+
4
+message = message.upper()
5
6
+for key in range(len(LETTERS)):
7
+ translated = ""
8
+ for symbol in message:
9
+ if symbol in LETTERS:
10
+ num = LETTERS.find(symbol)
11
+ num = num - key
12
+ if num < 0:
13
+ num = num + len(LETTERS)
14
+ translated = translated + LETTERS[num]
15
+ else:
16
+ translated = translated + symbol
17
18
+ print("Decryption using Key #%s: %s" % (key, translated))
0 commit comments