Neocortex 🧠

Search

Search IconIcon to open search

krypton3

Last updated Nov 16, 2021 Edit Source

We have 3 files, translated from english text that were encrypted from the same key. Since they are originally english, we can have a general idea of the key by counting the frequency of each character.

1
cat found* | grep -o . | sort | uniq -c

Website for more details

letter** count**** frequency**** equals**
P22.8409091e-3Z
H45.6818182e-3Q
R45.6818182e-3X
O120.017045455J
I190.026988636K
F280.039772727V
A550.078125B
L600.085227273P
E640.090909091Y
K670.095170455G
X710.10085227F
T750.10653409W
Y840.11931818M
M860.12215909U
W1290.18323864C
V1300.18465909L
Z1320.1875D
D2100.29829545R
C2270.32244318H
G2270.32244318S
N2400.34090909N
B2460.34943182I
U2570.36505682O
J3010.42755682A
Q3400.48295455T
S4560.64772727E
TOTAL7041

Single Letter Counts and Frequencies:

 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
ciphertext = "<<concatanted>>"
password = "KSVVW BGSJD SVSIS VXBMN YQUUK BNWCU ANMJS"
order = ['E','Q','T','S','O','R','I','N','H','C','L','D','U','P','M','F','W','G','Y','B','K','V','X','Q','J','Z']

def letter_order(string):
    counts = [0]*26
    order = ""
    for i in string:
        c = ord(i.upper()) - 65
        if -1 < c < 26:
            counts[c] += 1
    for i in range(26):
        m = (0,0)
        for j in range(26):
            if counts[j] > m[1]:
                m = (j,counts[j])
        counts[m[0]] = 0
        order += chr(65+m[0])
    return order

def genkeys(order):
    if len(order) == 0:
        return [""]
    keys = []
    for i in range(len(order[0])):
        if len(order[0]) > 1:
            neworder = [order[0][0:i] + order[0][i+1:]] + order[1:]
        else:
            neworder = order[1:]
        for j in genkeys(neworder):
            keys.append(order[0][i]+j)
    return keys

def solve(s,orig,ceasar):
    solved = ""
    for i in s:
        if 64 < ord(i.upper()) < 91:
            solved += orig[ceasar.find(i.upper())]
    return solved

cipherorder = letter_order(ciphertext)
for i in genkeys(order):
    print(i)
    print(cipherorder)
    print(solve(password, i, cipherorder))
1
2
3
EQTSORINHCLDUPMFWGYBKVXQJZ
SQJUBNCGDZVWMYTXKELAFIOHRP
WELLDONETHELEVELFOURPQSSWORDISBRUTE

The password is BRUTE


Interactive Graph