0x01 前言
picoCTF 2022的一道Cryptography题目,好评率只有25%,flag提交正确率只有9%,题目非常简单,主要是考察了Diffie-Hellman算法以及变异凯撒问题,其实不需要解Diffie-Hellman也可以得到flag,但为了加深对Diffie-Hellman的理解,还是简单记录一下。
0x02 解题
题目描述
Description:Alice and Bob wanted to exchange information secretly. The two of them agreed to use the Diffie-Hellman key exchange algorithm, using p = 13 and g = 5. They both chose numbers secretly where Alice chose 7 and Bob chose 3. Then, Alice sent Bob some encoded text (with both letters and digits) using the generated key as the shift amount for a Caesar cipher over the alphabet and the decimal digits. Can you figure out the contents of the message?
Hints1:Diffie-Hellman key exchange is a well known algorithm for generating keys, try looking up how the secret key is generated;
Hints2:For your Caesar shift amount, try forwards and backwards.
下载附件得到加密字符串:H98A9W_H6UM8W_6A_9_D6C_5ZCI9C8I_CB5EJHB6
Diffie-Hellman算法
Diffie-Hellman算法是Whitefield Diffie和Martin Hellman在1976年公布的一种秘钥交换算法。
Diffie-Hellman密钥交换方案的安全性都是取决于求离散对数问题的计算复杂性。
这篇文章讲的很清楚,有兴趣可以深入了解一下: