hidden_service_descriptor.py 文件源码

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

项目:llk 作者: Tycx2ry 项目源码 文件源码
def _decrypt_stealth_auth(content, authentication_cookie):
    from Crypto.Cipher import AES
    from Crypto.Util import Counter
    from Crypto.Util.number import bytes_to_long

    # byte 1 = authentication type, 2-17 = input vector, 18 on = encrypted content

    iv, encrypted = content[1:17], content[17:]
    counter = Counter.new(128, initial_value = bytes_to_long(iv))
    cipher = AES.new(authentication_cookie, AES.MODE_CTR, counter = counter)

    return cipher.decrypt(encrypted)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号