![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Crypto-RSA
RSA解题记录
qtL0ng
这个作者很懒,什么都没留下…
展开
-
CTFHub-历年真题-RSA(2018-百越杯-Crypto-RSA)
题目给了公钥文件pubkey.pem和密文flag.enc,还有下面的加密算法:#!/usr/bin/env python3import gmpy2from Crypto.Util.number import getPrimefrom Crypto.PublicKey import RSAfrom Crypto.Cipher import PKCS1_v1_5from base64 import b64encodeflag = open('flag', 'r').read().strip()原创 2022-04-15 11:21:24 · 873 阅读 · 0 评论 -
基于PKCS1_OAEP的RSA加解密
基于PKCS1_OAEP的RSA加解密# -*- coding: UTF-8 -*-from Crypto.PublicKey import RSAfrom Crypto.Cipher import PKCS1_OAEPimport libnumimport base64'''#注释部分为加密过程m = "flag{I_Really_Love_You_Very_much_Forver_every!}"pub = open('pubkey.pem').read()key = RSA.imp原创 2022-04-06 14:13:20 · 1957 阅读 · 0 评论 -
[MRCTF 2020] - RSA
easy_RSA题目:import sympyfrom gmpy2 import gcd, invertfrom random import randintfrom Crypto.Util.number import getPrime, isPrime, getRandomNBitInteger, bytes_to_long, long_to_bytesimport base64from zlib import *flag = b"MRCTF{XXXX}"base = 65537de原创 2020-07-02 22:23:19 · 570 阅读 · 0 评论 -
BUUCTF Crypto [GWCTF 2019]BabyRSA、[BJDCTF2020]easyrsa
一、题目下载题目得到encrypt.py和secret两个文件先来看看加密算法:import hashlibimport sympyfrom Crypto.Util.number import *flag = 'GWHT{******}'secret = '******'assert(len(flag) == 38)half = len(flag) / 2flag1 = flag[:half]flag2 = flag[half:]secret_num = getPrime(原创 2020-06-05 14:50:40 · 2421 阅读 · 0 评论 -
BUUCTF Crypto RSA4
低加密指数广播攻击题目如下:N = 33131032421200003002021431224423222240014241042341310444114020300324300210433321420203120221240340022003120214232243410414310424424121420444444332300024413012202242231020110441104403011330232301410133121430322331240243040240441303324313原创 2020-06-06 16:50:04 · 1924 阅读 · 2 评论 -
攻防世界 Crypto进阶 Handicraft_RSA
1、题目#!/usr/bin/pythonfrom Crypto.Util.number import *from Crypto.PublicKey import RSAfrom secret import s, FLAGdef gen_prime(s): while True: r = getPrime(s) #生成一个素数r R = [r] #将r转换为列表 t = int(5 * s / 2) + 1 for i i原创 2020-06-02 20:46:56 · 1351 阅读 · 1 评论 -
攻防世界 Crypto进阶 简单的rsa
1、题目#! /usr/bin/env python# -*- coding: utf-8 -*-from Crypto.Util.number import getPrime, long_to_bytes, bytes_to_long, isPrime, getRandomNBitIntegerfrom libnum import invmoddef destory(x, num): while True: dt = getRandomNBitInteger(num) r = x原创 2020-06-01 22:50:10 · 3214 阅读 · 1 评论 -
攻防世界 Crypto best_rsa
题目给了两个密文文件和两个公钥文件,首先解析一下公钥,命令:openssl rsa -pubin -text -modulus -in publickey2.pem由于对openssl rsa命令不熟,这里做一下记录:用法:openssl rsa [inform PEM|NET|DER] [-outform PEM|NET|DER] [-in filename] [-passin arg] [-out filename] [-passout arg] [-sgckey] [-text] [-n原创 2020-05-31 14:27:37 · 1962 阅读 · 3 评论