---
# System prepended metadata

title: 'Bamboofox/train/ccr [50]'
tags: [Crypto, CTF, Bamboofox, writeup]

---

# Bamboofox/train/ccr [50]
###### tags: `CTF`,`Crypto`,`Bamboofox`,`writeup`
題目檔案連結：http://gofile.me/6lhQ2/uzLcFsqO1
hash的計算是依序將五個字元的ascii相加，提示的地方說了前五個字元，寫迴圈算一下
```
flag = [70,76,65,71,123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
hash = [405, 434, 457, 506, 467, 449, 465, 398, 381, 459, 465, 466, 538, 542, 546, 467, 449, 453, 463, 448, 523, 457, 448, 442, 455, 452, 521, 536, 463, 460, 467, 466, 453, 467, 483, 372]
def count(s,start,end):
    sum = 0
    for i in range(start,end):
        sum += s[i]
    return sum
def checksum(s):
    for i in range(0,35):
        if count(s,i,i+5) !=hash[i]:
            s[i+4] =  hash[i]-count(s,i,i+5)
    return 1
checksum(flag)
Flag = ""
for i in range(len(flag)):
    Flag += chr(flag[i])
print(Flag)
```