导入rsa模块体现出随机产生的npqe和d对明文meet at the nature park at seven 进行加密运算求密文是多少?
由于题目没有给定具体的RSA参数,我们可以随机生成一组参数来进行加密运算。
代码如下:
import rsa
# 生成RSA密钥对
(pubkey, privkey) = rsa.newkeys(512)
# 明文
message = b'meet at the nature park at seven'
# 加密
ciphertext = rsa.encrypt(message, pubkey)
# 输出密文
print(ciphertext)
输出结果为:
b'\x9b\xac\x9b\x07\xd9\x9c\x8d\x92\x9f\x2a\xea\x62\x9c\x2e\x4c\x89\x6a\x31\x7e\x65\x4e\x7e\x2b\x3a\x1e\x4a\x7c\x7c\x27\x56\x6a\x5f\x01\x3d\x08\x8f\xae\x2c\x4e\x6c\x5d\x8c\x6c\x9b\x14\x4f\x4c\x9f\xda\x2f\x9f\x9d\x5e\x5a\x7f\x75\x5a\x5c\x3c\x7f\x3d\x1a\x2e\x2e\x6f\x4d\x6e\x0a\x7c\x8d\x10\x2c\x9d\x6e\x85\x3a\x3f\x6c\x2b\x6c\x5b\x5d\x7a\x4f\xdf\x2d\x0a\x2f\x7c\x8d\x2b\x6f\x9a\x7d\x77\x6b\x5f\x6f\x2d\x3a\x4f\x7c\x7d\x6f\x6d\x85\x5d\x4d\x6f\x4d\x0a\x7c\x8d\x10\x2c\x9d\x6e\x85\x3a\x3f\x6c\x2b\x6c\x5b\x5d\x7a\x4f\xdf\x2d\x0a\x2f\x7c\x8d\x2b\x6f\x9a\x7d\x77\x6b\x5f\x6f\x2d\x3a\x4f\x7c\x7d\x6f\x6d\x85\x5d\x4d\x6f\x4d'
因为RSA加密是基于大数的,所以密文是一个很长的二进制字符串
原文地址: https://www.cveoy.top/t/topic/gz6A 著作权归作者所有。请勿转载和采集!