reencrypter.py 文件源码

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

项目:ISIM-LDAP-Sifter 作者: alexivkin 项目源码 文件源码
def reencrypt(self, data):
        try:
            self.decoder = DES.new(self.key, DES.MODE_CBC, self.iv) # need to reinit it each time because of CBC
            decrypted=self.unpad(self.decoder.decrypt(base64.b64decode(data)))
            if debug:
                if len(decrypted)==8 and re.match(self.autogen,decrypted) is not None:
                    self.debugf.write(self.currentdn+" =* "+decrypted+"\n")
                elif re.match(self.alphanumchar,decrypted) is not None:
                    self.debugf.write(self.currentdn+" => "+decrypted+"\n")
                else:
                    self.debugf.write(self.currentdn+" =x "+decrypted+"\n")
            encrypted=self.encoder.encrypt(self.pad(decrypted))
            newdata=base64.b64encode(encrypted)
            return newdata
        except:
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号