crypto.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:CVE-2017-7494 作者: joxeankoret 项目源码 文件源码
def basic_encrypt(cls, key, plaintext):
        assert len(plaintext) >= 16
        aes = AES.new(key.contents, AES.MODE_CBC, '\0' * 16)
        ctext = aes.encrypt(_zeropad(plaintext, 16))
        if len(plaintext) > 16:
            # Swap the last two ciphertext blocks and truncate the
            # final block to match the plaintext length.
            lastlen = len(plaintext) % 16 or 16
            ctext = ctext[:-32] + ctext[-16:] + ctext[-32:-16][:lastlen]
        return ctext
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号