Exemplo n.º 1
0
 def decrypt(self,block):
     cipherText = serpent_ref.convertToBitstring(block.encode("hex").lower()[::-1], 128)
     plainText = serpent_ref.decrypt(cipherText, self.userKey)
     return serpent_ref.bitstring2hexstring(plainText)[::-1].decode('hex')
Exemplo n.º 2
0
 def decrypt(self, block):
     cipherText = serpent_ref.convertToBitstring(
         block.encode("hex").lower()[::-1], 128)
     plainText = serpent_ref.decrypt(cipherText, self.userKey)
     return serpent_ref.bitstring2hexstring(plainText)[::-1].decode('hex')
Exemplo n.º 3
0
 def decrypt(self,block):
     cipherText = serpent_ref.convertToBitstring(hexlify(block).decode().lower()[::-1], 128)
     plainText = serpent_ref.decrypt(cipherText, self.userKey)
     return unhexlify(serpent_ref.bitstring2hexstring(plainText)[::-1].encode())
Exemplo n.º 4
0
 def decrypt(self, block):
     cipherText = serpent_ref.convertToBitstring(revString(block.hex()),
                                                 128)
     plainText = serpent_ref.decrypt(cipherText, self.userKey)
     return codecs.decode(
         serpent_ref.bitstring2hexstring(plainText)[::-1], "hex_codec")