import random
import hashlib
import string
#字符串列表
a=string.printable
#随机生成flagfor i inrange(10):
flag =""for i inrange(10):
flag += a[random.randint(0,99)]
flag = hashlib.md5(flag.encode()).hexdigest()print("flag{"+ flag +"}")from uuid import uuid1
flag="flag{"+str(uuid1())+"}"print(flag)
2022奇偶数位移脚本
flag ="catflag{xxxxxxxxxxxxxxxxxx}"
f =2022for i inrange(len(flag)):if i%2==1:print((int(ord(flag[i])- f*ord(flag[i]))),end='')else:print((int(ord(flag[i])+ f*ord(flag[i]))), end='')
键盘坐标密码
import re
key_list =[['q','w','e','r','t','y','u','i','o','p'],['a','s','d','f','g','h','j','k','l'],['z','x','c','v','b','n','m']]
flag ="catf1ag{xxxxxxxxxxx}"
flag_content = re.findall(r'{(.*?)}',flag)[0]for flag in flag_content:for i,key_lists inenumerate(key_list):for i2,key inenumerate(key_lists):if key == flag:print(str(i+1)+str(i2+1),end=' ')
杰斐逊转轮密码
import random
import json
a ='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
flag ='XXXXXXXXXXXXXXXXXXXXXXXXXX'.upper()
roller_list =[]for i inrange(len(flag)):
dic =['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
random.shuffle(dic)
roller_list.append(dic)#print((roller_list))
num =(random.randrange(1,26))print(num)
secret =''for i,word inzip(roller_list,flag):print(''.join(i))
list_s =(i[i.index(word):]+ i[:i.index(word)])#print(list_s)
secret+=list_s[num]print(secret)
栅栏密码逆序扣去填充字符
flag ="catf1ag{xxxxxxxxxxxxxxxx}"print(len(flag))
num=9#flag长度比最接近的num倍数小
flag1 = flag+('@'*int(num -len(flag)%num))print(len(flag1))print((flag1))
secret =''for i inrange(num):
secret +=(flag1[i]+flag1[num*1+i]+flag1[num*2+i])print(secret[::-1].replace('@',''))
异或变异
a ='catf1ag{xxxxxxxxx}'
f =1
secret =''for i in a:
secret +=(chr(ord(i)^f))
f+=1print(len(secret))withopen('secret.txt','w')as f:
f.write(secret)
RGBA通道隐写
from PIL import Image
MAX =41
pic = Image.new('RGBA',(MAX,MAX))
pix_list =[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,255,255,0,255,255,255,0,0,255,0,255,0,255,0,0,0,0,0,255,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,255,255,255,255,255,0,255,255,255,0,0,0,255,255,0,255,0,255,0,0,255,255,255,0,255,0,255,255,255,255,255,0,255,255,255,255,255,255,255,255,0,255,0,0,0,255,0,255,255,0,255,255,0,0,255,255,255,0,0,0,255,255,255,255,255,255,0,255,0,0,0,255,0,255,255,255,255,255,255,255,255,0,255,0,0,0,255,0,255,255,0,255,255,0,0,255,0,255,255,255,255,0,0,255,255,255,255,0,255,0,0,0,255,0,255,255,255,255,255,255,255,255,0,255,0,0,0,255,0,255,255,255,0,255,255,0,255,255,0,255,0,255,0,255,0,0,0,255,0,255,0,0,0,255,0,255,255,255,255,255,255,255,255,0,255,255,255,255,255,0,255,0,0,255,0,255,0,0,0,0,0,0,0,255,255,0,255,0,255,0,255,255,255,255,255,0