# [Crypto] VENI VIDI VICI {%hackmd M1bgOPoiQbmM0JRHWaYA1g %} > -👤堇姬 ## Step.1 分析一下題目跟題敘他應該跟**凱薩密碼**有關。 ## Step.2 **tbtjtTKW{Trv3ri_1j_j0_t0f1!}** 已知格式為 **ckcscCTF{}**,所以分析偏移量,t跟c相差9。 ## Step.3 丟到解碼器得到答案 http://www.atoolbox.net/Tool.php?Id=778 ![](https://hackmd.io/_uploads/SkTm1iT16.png) ## Another ways 不想分析偏移量的話其實可以直接暴力解,畢竟凱薩密碼只有26種可能。 **Solve Script :** ```py def is_eng(c): if (ord(c) >= 97 and ord(c) <= 122) or (ord(c) >= 65 and ord(c) <= 90): return True else : return False #是否為大寫或小寫字母 n = "tbtjtTKW{Trv3ri_1j_j0_t0f1!}" for x in range(1,26) : #窮舉偏移量為1~25 result = str() for i in range(len(n)): a = n[i] if is_eng(a): if ord(a) < 97: result += chr((ord(a) + x - 65) % 26 + 65) else: result += chr((ord(a) + x - 97) % 26 + 97) else : result += a print(result) ```