# ROT13 Problem --- - 50pt - 390solves 組織でも指折りの経験豊富なベテランからチャットが来ました。ですが普通の文字列ではなく暗号文になっているようです。どうやらこのベテランも暇なようです。 以下の文字列を解読して、フラグを獲得してください。 `synt{Rira_lbh_Oehghf?}` Solve --- 名前の通り13が鍵のシフト暗号 シーザー暗号の26通り全探索のプログラムがそのまま使える ```python= flag = "synt{Rira_lbh_Oehghf?}" for i in range(0,26): m='' for j in range(len(flag)): tmp = ord(flag[j]) if tmp < ord('A'): m+=chr(tmp) elif ord('Z') < tmp & tmp < ord('a'): m+=chr(tmp) elif ord('z') < tmp: m+=chr(tmp) # 小文字 elif tmp>=ord('a'): if (tmp+i)>ord('z'): tmp=tmp+(i-26) m+=chr(tmp) else: tmp=tmp+i m+=chr(tmp) # 大文字 elif tmp>=ord('A'): if (tmp+i)>ord('Z'): tmp=tmp+(i-26) m+=chr(tmp) else: tmp=tmp+i m+=chr(tmp) print(i,m) ``` Flag --- :tada: flag{Even_you_Brutus?} ###### tags: `setodaNoteCTF` `crypto`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up