crypto.py 文件源码

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

项目:CVE-2017-7494 作者: joxeankoret 项目源码 文件源码
def decryptSecret(key, value):
    # [MS-LSAD] Section 5.1.2
    plainText = ''
    key0 = key
    for i in range(0, len(value), 8):
        cipherText = value[:8]
        tmpStrKey = key0[:7]
        tmpKey = transformKey(tmpStrKey)
        Crypt1 = DES.new(tmpKey, DES.MODE_ECB)
        plainText += Crypt1.decrypt(cipherText) 
        cipherText = cipherText[8:]
        key0 = key0[7:]
        value = value[8:]
        # AdvanceKey
        if len(key0) < 7:
            key0 = key[len(key0):]

    secret = LSA_SECRET_XP(plainText)
    return (secret['Secret'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号