-
-
[原创]第二题子鼠开天
-
发表于: 2020-4-16 17:14 2721
-
题目用了AES+SHA512+MD5+大数运算,然而几乎没用,不仅这样还出现了多解的情况,详细看截图。题目更新实在是没有收到消息,这也就算了,更新完之后就加了一个限制结果还是多解???
import hashlib def f(x): return hashlib.md5(hashlib.sha512(x).digest()).digest() def ff(x): x+= b'\xde\xed\xbe\xef' x = f(x) x += b'\xB9\x79\x37\x9E' return f(x) print("".join(list(map(lambda x: '\\'+hex(x)[1:],ff(b'KCTF')))))
#include <stdio.h> #include <openssl/bn.h> #include <openssl/aes.h> int main () { /* I shortened the integer */ unsigned char p_str[] = "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\xaf\x58\xad\x4d\x76\xd5\x9d\x8d\x21\x71\xff\xb4\xca\x22\x31"; unsigned char key[] = "\x69\x82\x30\x28\x57\x74\x65\xAB\x39\x91\xDF\x04\x51\x46\xF9\x1D\x55\x6D\xEE\x88\x70\x84\x5D\x8E\xE1\xCD\x3C\xF7\x7E\x4A\x0C\x39"; unsigned char d_str[] = "\x39\x0a\x68\x4c\xb7\x13\x37\x8f\xfd\x5c\xce\x8c\x40\x00\xb5\xd6\xa2\xbb\x9f\x29\xb6\x3d\x39\x5e\x6b\xe6\xe9\xdd\x94\x15\x27\xbd"; BIGNUM *p = BN_bin2bn(p_str, 32, NULL); BIGNUM *mod = BN_bin2bn(key, 32, NULL); BIGNUM *d = BN_bin2bn(d_str, 32, NULL); BIGNUM *e = BN_new(); BIGNUM *r = BN_new(); BN_set_word(e, 0x10001); BN_CTX *ctx = BN_CTX_new(); BN_mod_exp(r, p, d, mod, ctx); char * number_str = BN_bn2hex(r); printf("%s\n", number_str); unsigned char mid[32]; unsigned char mid2[32]; BN_bn2bin(r, mid); unsigned char kkey[] = "\x48\x0B\x62\xC3\xAC\xD6\xC8\xA3\x6B\x18\xD9\xE9\x06\xCD\x90\xD2"; AES_KEY aes_key; AES_set_encrypt_key(kkey, 128, &aes_key); AES_ecb_encrypt(mid, mid2, &aes_key, 1); AES_ecb_encrypt(mid+16, mid2+16, &aes_key, 1); for(int i = 0; i != 32; ++i) printf("%x", mid2[i]); puts(""); BN_free(p); return 0; }
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
赞赏
他的文章
- [原创]第二题子鼠开天 2722
- [已解决]qemu如何进入monitor模式? 3999
- [求助]v8引擎编译debug问题 3444
看原图
赞赏
雪币:
留言: