encryption.py 文件源码

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

项目:Veil 作者: Veil-Framework 项目源码 文件源码
def aes_encryption(incoming_shellcode, encryption_pad=4):
    # Generate a random key, create the cipher object
    # pad the shellcode, and encrypt the padded shellcode
    # return encrypted -> encoded shellcode and key
    random_aes_key = helpers.randomKey()
    iv = helpers.randomString(16)
    aes_cipher_object = AES.new(random_aes_key, AES.MODE_CBC, iv)
    padded_shellcode = encryption_padding(incoming_shellcode, encryption_pad)
    encrypted_shellcode = aes_cipher_object.encrypt(padded_shellcode)
    encoded_ciphertext = base64.b64encode(encrypted_shellcode)
    return encoded_ciphertext, random_aes_key, iv
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号