V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
song135711
V2EX  ›  Python

根据步骤得写 python3 解密代码

  •  
  •   song135711 ·
    Song2017 · 2020-08-12 18:06:58 +08:00 · 2022 次点击
    这是一个创建于 1324 天前的主题,其中的信息可能已经有所发展或是发生改变。

    请教下 V 友, 能根据下面的步骤, 写出 python3 解密代码么

    加密:(目前不提供 Demo,解密请参考解密步骤)

    以下明文信息的字符串经 utf-8 编码后经 RSA 用公钥加密,以 data 字段发送,用 RSA 私钥解密。

    注:采用分区块加密,每个 block 的大小为 117 个字节。
    RSA 私钥请登录测试环境 - 获取密钥 -点击 rsa_private_key 获取。
    使用 JAVA 需要将私钥转换为 pcks8 的商家,请在后台获取私钥后将私钥以 64 位为一行转换为 PEM 文件,举例文件名为 rsa_private_key.pem ,然后使用 openssl 交互输入:
    pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM –nocrypt 转换; 或使用
    openssl pkcs8 -topk8 -nocrypt -inform PEM -in rsa_private_key.pem -outform PEM outform

    解密步骤

    1. 获取密文后使用 base64 decode
    2. 以 128 字节分块对密文解密
    3. 拼接解密模块组成完整报文
    3 条回复    2020-08-19 13:10:01 +08:00
    phpfpm
        1
    phpfpm  
       2020-08-12 20:11:06 +08:00   ❤️ 1
    几个菜啊喝成这样

    给多少钱做这个?
    PassionJack
        2
    PassionJack  
       2020-08-12 22:16:36 +08:00
    很简单的解密啊
    song135711
        3
    song135711  
    OP
       2020-08-19 13:10:01 +08:00
    不好意思, 解密了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1130 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:53 · PVG 06:53 · LAX 15:53 · JFK 18:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.