1

Decode Text encrypted with DH coded with Caesar Cipher.

We have to decode following text: FKXSQBQZACKFAHRSCAN DFYZSYQBSFN. I have tried to "guess" the private Key for Alice with a for loop and think I got the right one but now I'm stuck. p,g and A are given.

p = 23
g = 15
A = 6 #exchangeKey Alice

I think the problem could be that I don't know how the text is coded. Did the teacher use an array like?:

alphabet = ["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"]

Or did she use the ASCII table.

But is it even possible to decode this text without any information about "Bob". My research brought only information about MITM attacks where the hacker got p,g,A and B

Get Alicekey

for getkeyalice in range(p):
    if (g**getkeyalice)%p == A:
        keyalice = getkeyalice

Decode

for char in message:
    #index=(alphabet.index(char)-j)
    #decryptedlst.append(alphabet[index])
    decryptedlst.append(chr(ord(char)-i))
    decrypted = ''.join(decryptedlst)
    print("decrypted message:\t"+str(decrypted))

I'm looking for the decryption key. I don't expect this should be a very high number. But even bruteforcing all numbers from 1-4096 didn't help. So back to the top.... perhaps the kind of decryption I'm using is different to the encryption of the teacher.

mab
  • 11
  • 2

1 Answers1

0

This problem can not be resolved due to a lack of input.

Even if you can easily brute-force Alice's private key, that is 14 (15¹⁴[23]≡6[23]), you have not any information about Bob's choice of key values, so you have no information that could help you find the DH shared secret between Alice and Bob. This is because the shared secret depends both on informations chosen from Alice and on informations chosen by Bob. Therefore, you can not cryptanalyze this problem.

Alexandre Fenyo
  • 4,526
  • 1
  • 17
  • 24