2020年UMDCTF,类Crypto题目Baby's First,WriteUp

ucole 2026-01-30 10:02:00 49 0 返回题目详情


#位移后,flag会出现
#改好附件ciphertext.txt实际路径,在python3环境中执行就可以得到flag
#最终执行结果是UMDCTF-{1_1uv_crypt0}
#python代码如下:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
with open('d://ciphertext.txt', 'rb') as f:
enc = f.read()

# 注意:enc[0] 已经是整数(bytes 的单个字节),不需要 ord()
key = enc[0] - ord('U')

flag = ''
for c in enc:
# c 已经是整数(0-255 之间),不需要 ord()
code = (c - key) % 128
flag += chr(code)
print(flag)

分类:Crypto
image
作者:ucole

4

提交

1

收入

相关WriteUP

问题反馈