![](https://img-blog.csdnimg.cn/20190927151132530.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
密码小白刷题记录
文章平均质量分 61
CTF密码入门必刷题目,来自BUU,攻防世界
无名函数
整装洒扫,迎接新的一天
展开
-
2022-04-18
[BSidesCF 2019]RsaOSmachine@machine-virtual-machine:~$ nc node4.buuoj.cn 25349 ___ ___ ___ ___ ___ /\ \ /\ \ /\ \ /\ \ /\ \ /::\ \ /::\ \ /原创 2022-04-18 22:14:53 · 347 阅读 · 0 评论 -
2022-04-05
[羊城杯 2020]Simplefrom Crypto.Util.number import *from Crypto.Cipher import DESimport gmpy2from secret import flagimport randomkey = "abcdefgh"def des_encrypt(m): des = DES.new(key, DES.MODE_ECB) res = des.encrypt(m) return resdef gen_原创 2022-04-05 18:22:22 · 838 阅读 · 0 评论 -
2021-12-31
[XNUCA2018]baby_cryptolen(key_a) = mlen(key_k) = nc[i] = (p[i] * key_a[i % m] + key_k[i % n]) % 26p is plain text, only lowercase letters are refered to.c is encrypted textI have appended the flag at the end of plain text, the format of which is li原创 2021-12-31 23:20:05 · 105 阅读 · 0 评论 -
2021-12-27
[watevrCTF 2019]Crypto over the intrawebs原创 2021-12-27 22:17:43 · 444 阅读 · 0 评论 -
2021-10-15
smfrom Crypto.Util.number import getPrime,long_to_bytes,bytes_to_longfrom Crypto.Cipher import AESimport hashlibfrom random import randintdef gen512num(): order=[] while len(order)!=512: tmp=randint(1,512) if tmp not in order:原创 2021-10-15 23:25:00 · 192 阅读 · 0 评论 -
2021-09-25
DASCTF Sept X 浙江工业大学秋季挑战赛crypto签到题目#!/usr/bin/env python# -*- coding: utf-8 -*-from Crypto.Util.number import *import randomflag=b'flag{******************}'n = 2 ** 256flaglong=bytes_to_long(flag)m = random.randint(2, n-1) | 1c = pow(m, flaglon原创 2021-09-25 23:23:08 · 1363 阅读 · 2 评论 -
[b01lers2020]dollar_lunch
[b01lers2020]dollar_lunch题目import sysN = 225182133924012648184112785444818439142324328304585414148854583778782667934987507723545923959336295384301687043573676773660635064378407461141096985618182136531553375163320459075845385602073474575188157501431654原创 2021-09-10 20:45:31 · 230 阅读 · 0 评论 -
[GKCTF 2021]XOR
[GKCTF 2021]XOR题目from Crypto.Util.number import *from hashlib import md5a = getPrime(512)b = getPrime(512)c = getPrime(512)d = getPrime(512)d1 = int(bin(d)[2:][::-1] , 2)n1 = a*bx1 = a^bn2 = c*dx2 = c^d1flag = md5(str(a+b+c+d).encode()).hexdi原创 2021-08-28 22:06:40 · 985 阅读 · 1 评论 -
[BSidesSF2020]haystack
[BSidesSF2020]haystack题目This vendor claims they have figured out a way to preserve the integrity and confidentiality of a message using signing instead of encryption. We only have a binary pycache file and a message off the wire – can you find the cont原创 2021-09-05 23:01:51 · 313 阅读 · 0 评论 -
[pasecactf_2019]tornado_casino
[pasecactf_2019]tornado_casino题目from sys import argvfrom random import getrandbitsflag = '<redacted>'tornado_banner = ''' 88 ,d原创 2021-08-29 22:53:38 · 632 阅读 · 0 评论 -
[UTCTF2020]Cube Crypto
[UTCTF2020]Cube Crypto题目Mr. Anshel and Mr. Goldfeld were trying to exchange some asymmetric keys to get a shared key. They aren’t very good at math, so they decided to use a Rubik’s Cube instead to do the crypto. I don’t think it’s very secure though, I原创 2021-08-24 23:19:53 · 750 阅读 · 0 评论 -
uvw77ay_aiffip
uvw77ay_aiffip题目小明听说某软件会自动备份自己的聊天记录,非常恼火,一怒之下设计了个超级基础协商协议。某天他准备和你通讯,发给你了一段协商消息,附件中还有公用生成元g和你的私钥,以及保证密钥长度的质数。那么,你们的最后协商的32位密钥是啥呢?(题目标题有玄机,答案为32位的十进制数) 注意:得到的 flag 请包上 flag{} 提交你们共同有一个公开已知生成元g=34你的私钥=9360小明向你发来协商数据:57687185873717832710418532982088保证原创 2021-09-04 10:12:16 · 473 阅读 · 0 评论 -
强网杯2019 Copperstudy
强网杯2019 Copperstudy靶机:node4.buuoj.cn:25381原创 2021-08-13 22:54:50 · 975 阅读 · 1 评论 -
[羊城杯 2020]GMC
[羊城杯 2020]GMC题目from Crypto.Util.number import getPrime,bytes_to_long,getRandomNBitIntegerfrom secret import flagfrom gmpy2 import gcddef gmc(a, p): if pow(a, (p-1)//2, p) == 1: return 1 else: return -1def gen_key(): [原创 2021-08-22 22:37:29 · 312 阅读 · 0 评论 -
[NPUCTF2020]Mersenne twister
[NPUCTF2020]Mersenne twister题目cef4876036ee8b55aa59bca043725bf350a5e491debdef7ef7d63e9609a288ca1e2c82a7fe566bd8709e73c8d495ea504a486ed11189faf8e6fb35617e47d2d1ad5e4783e96afeaae9f7104ec477fb39fe4ec619bf58289709e15c4449f03fc51cba918cd0ebfdc12376b41e78154064原创 2021-08-19 22:58:03 · 622 阅读 · 0 评论 -
[De1CTF2019]Babylfsr
[De1CTF2019]Babylfsr题目import hashlibfrom secret import KEY,FLAG,MASKassert(FLAG=="de1ctf{"+hashlib.sha256(hex(KEY)[2:].rstrip('L')).hexdigest()+"}")assert(FLAG[7:11]=='1224')LENGTH = 256assert(KEY.bit_length()==LENGTH)assert(MASK.bit_length()==L原创 2021-08-18 22:31:02 · 395 阅读 · 0 评论 -
[CISCN2018]crackme-java
[CISCN2018]crackme-java题目import java.math.BigInteger;import java.util.Random;public class Test0 { static BigInteger two =new BigInteger("2"); static BigInteger p = new BigInteger("113607382951770029984953840578931299649801318065095729278866758原创 2021-08-16 22:59:12 · 314 阅读 · 0 评论 -
[GKCTF 2021]RRRRsa
[GKCTF 2021]RRRRsa题目from Crypto.Util.number import *from gmpy2 import gcdflag = b'xxxxxxxxxxxxx'p = getPrime(512)q = getPrime(512)m = bytes_to_long(flag)n = p*qe = 65537c = pow(m,e,n)print('c={}'.format(c))p1 = getPrime(512)q1 = getPrime(512原创 2021-08-15 22:08:18 · 614 阅读 · 0 评论 -
[watevrCTF 2019]Baby RLWE
[watevrCTF 2019]Baby RLWE题目baby_rlwe.sagefrom sage.stats.distributions.discrete_gaussian_polynomial import DiscreteGaussianDistributionPolynomialSampler as d_gaussflag = bytearray(raw_input())flag = list(flag)n = len(flag)q = 40961## Finite Fie原创 2021-08-14 23:24:40 · 519 阅读 · 0 评论 -
[GKCTF 2021]Random
[GKCTF 2021]Random题目import randomfrom hashlib import md5def get_mask(): file = open("random.txt","w") for i in range(104): file.write(str(random.getrandbits(32))+"\n") file.write(str(random.getrandbits(64))+"\n") file.原创 2021-08-12 22:39:39 · 2927 阅读 · 3 评论 -
[BSidesSF2020]decrypto-2
[BSidesSF2020]decrypto-2题目Kerckhoffs’s principle states that “A cryptosystem should be secure even if everything about the system, except the key, is public knowledge.” So here’s our really unbreakable cipher.flag.svg.encimport hashlibimport struct原创 2021-08-11 23:09:56 · 239 阅读 · 0 评论 -
[羊城杯 2020]Power
[羊城杯 2020]Power题目from Crypto.Util.number import *import gmpy2from secret import flagp = getPrime(512)q = getPrime(512)n = p**4*qe = 0x10001phi = gmpy2.lcm(p - 1, q - 1)d = gmpy2.invert(e, phi)dp = d % (p - 1)m = bytes_to_long(flag)c = pow(m,原创 2021-08-10 22:56:32 · 472 阅读 · 0 评论 -
[BSidesSF2020]decrypto-1
[BSidesSF2020]decrypto-1题目Kerckhoffs’s principle states that “A cryptosystem should be secure even if everything about the system, except the key, is public knowledge.” So here’s our unbreakable cipher.import sysimport jsonimport hashlibclass Cryp原创 2021-08-08 23:08:00 · 256 阅读 · 0 评论 -
[CISCN2018]oldstreamgame
[CISCN2018]oldstreamgame题目key 000644 000765 000024 00000000144 13256665261 011660 0原创 2021-08-07 23:03:44 · 320 阅读 · 0 评论 -
[Zer0pts2020]ROR
[Zer0pts2020]ROR题目import randomfrom secret import flagror = lambda x, l, b: (x >> l) | ((x & ((1<<l)-1)) << (b-l))N = 1for base in [2, 3, 7]: N *= pow(base, random.randint(123, 456))e = random.randint(271828, 314159)m原创 2021-08-06 22:41:02 · 394 阅读 · 0 评论 -
[BSidesSF2019]slashslash
[BSidesSF2019]slashslash题目flag.aes128cbcSalted__y?鎈~鼽 m瘫寀閖3郇饱碽1ヵ戦屃堠M鼆€原创 2021-08-05 23:01:37 · 253 阅读 · 0 评论 -
2021-08-04
[GUET-CTF2019]Uncle Samdef generkey(k): p, q = getPrime(k), getPrime(k) pubkey = p**2 * q n = pubkey l = (p-1)*(q-1) / gcd(p-1, q-1) privkey = inverse(n, l) return pubkey, privkeydef encrypt(m, pubkey): return原创 2021-08-04 22:21:38 · 223 阅读 · 0 评论 -
2021-08-03
标题加粗样式加粗样式原创 2021-08-03 17:54:40 · 142 阅读 · 0 评论 -
[INSHack2018]Crypt0r part 1
[INSHack2018]Crypt0r part 1题目description.md# Crypt0r part 1Our IDS detected an abnormal behavior from one of our user. We extracted this pcap, could you have a look at it? <a href="http://crypt0r.challenge-by.ovh/ids_alert_24032018.pcap">http:原创 2021-08-02 23:11:34 · 430 阅读 · 0 评论 -
[羊城杯 2020]RRRRRRRSA
[羊城杯 2020]RRRRRRRSA题目import hashlibimport sympyfrom Crypto.Util.number import *flag = 'GWHT{************}'flag1 = flag[:19].encode()flag2 = flag[19:].encode()assert(len(flag) == 38)P1 = getPrime(1038)P2 = sympy.nextprime(P1)assert(P2 - P1 <原创 2021-08-01 22:34:22 · 382 阅读 · 0 评论 -
[NCTF2019]Reverse
[NCTF2019]Reverse题目汮S賳!Ⅳ?Z_l,?漋& hDa莸&5匼?oZ€|U€骸%#}巴import osimport pyDesflag = "NCTF{******************************************}"key = os.urandom(8)d = pyDes.des(key)cipher = d.encrypt(flag.encode())with open('cipher', 'wb') as f原创 2021-07-31 19:51:26 · 449 阅读 · 0 评论 -
2021-07-30
[AFCTF2018]一道有趣的题目题目#加密代码def encrypt(plainText): space = 10 cipherText = "" for i in range(len(plainText)): if i + space < len(plainText) - 1: cipherText += chr(ord(plainText[i]) ^ ord(plainText[i + space])) el原创 2021-07-30 23:03:52 · 501 阅读 · 0 评论 -
2021-07-29
LeftOrRight题目Left?Middle?No,I want right!(flag is right?!)解题用010Editor打开JPG应该是以FFD8开头,将这之前的删去后得到:原创 2021-07-29 23:07:25 · 310 阅读 · 0 评论 -
2021-07-28
[watevrCTF 2019]ECC-RSA题目from fastecdsa.curve import P521 as Curvefrom fastecdsa.point import Pointfrom Crypto.Util.number import bytes_to_long, isPrimefrom os import urandomfrom random import getrandbitsdef gen_rsa_primes(G): urand = bytes_to_lon原创 2021-07-28 22:06:41 · 276 阅读 · 2 评论 -
2021-07-23
[ACTF新生赛2020]crypto-des题目encryptedkey72143238992041641000000.000000,77135357178006504000000000000000.000000,1125868345616435400000000.000000,67378029765916820000000.000000,75553486092184703000000000000.000000,4397611913739958700000.000000,76209378原创 2021-07-23 23:41:40 · 849 阅读 · 0 评论 -
BUU-crypto-刷题记录29
[UTCTF2020]hill题目wznqca{d4uqop0fk_q1nwofDbzg_eu}解题希尔密码(Hill Cipher)是运用基本矩阵论原理的替换密码,由Lester S. Hill在1929年发明。每个字母当作26进制数字:A=0, B=1, C=2… 一串字母当成n维向量,跟一个n×n的矩阵相乘,再将得出的结果MOD26。如信息“NOSLEEPPING”对应着一组编码14,15,19,12,5,5,16,16,9,14,7。但如果按这种方式直接传输出去,则很容易被敌方破译。于是原创 2021-07-16 22:43:13 · 500 阅读 · 0 评论 -
BUU-crypto-刷题记录28
[De1CTF2019]babyrsa题目import binasciifrom data import e1,e2,p,q1p,q1q,hint,flagn = [20129615352491765499340112943188317180548761597861300847305827141510465619670536844634558246439230371658836928103063432870245707180355907194284861510906071265352409579原创 2021-07-15 22:28:10 · 271 阅读 · 0 评论 -
BUU-crypto-刷题记录27
[NPUCTF2020]Classical Cipher题目key解密后的flag请用flag{}包裹压缩包密码:gsv_pvb_rh_zgyzhs对应明文: ***_key_**_******解题压缩包里面是一张照片,打开需要密码gsv_pvb_rh_zgyzhs,不对,pvb不对,gsv_key_rh_zgyzhs还是不对忽然意识到,gsv_pvb_rh_zgyzhs是密码的密文,明文是***key_****那就是替换密码了,在线替换解密得到159种结果,符合明文条件的也不原创 2021-07-14 23:23:01 · 791 阅读 · 0 评论 -
BUU-crypto-刷题记录26
EasyProgram题目Eeemmm…this is a easy game.Have fun~file 簭+"烸?K?镝?灸註? z?Q碉=??附件get buf unsign s[256]get buf t[256]we have key:whoamiwe have flag:????????????????????????????????for i:0 to 256 set s[i]:ifor i:0 to 256 set t[i]:key[(i)原创 2021-07-13 23:12:14 · 361 阅读 · 0 评论 -
BUU-crypto-刷题记录25
[ACTF新生赛2020]crypto-classic1题目hin哇,这里有压缩包的密码哦,于是我低下了头,看向了我的双手,试图从中找到某些规律xdfv ujko98 edft54 xdfv pok,.; wsdr43解题看向自己的双手,xdfv ujko98 edft54 xdfv pok,.; wsdr43键盘加密,每组字母包围起来的字母分别为:circle解压,得到:SRLU{LZPL_S_UASHKXUPD_NXYTFTJT}提示是维吉尼亚加密,c='SRLU{LZPL_S_U原创 2021-07-12 22:45:09 · 758 阅读 · 0 评论