Answer the question
In order to leave comments, you need to log in
How to decrypt a hexadecimal value, having a key, using the DES algorithm?
Given a pair of a sixteen-byte value and its key, encrypted using the DES algorithm in ECB mode. How to decrypt the original value? Tell me the algorithm and what to read on this topic. Also interested in TripleDES in CBC mode.
Answer the question
In order to leave comments, you need to log in
from pyDes import *
data = "Please encrypt my data"
k = des("DESCRYPT", CBC, "\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_PKCS5)
d = k.encrypt(data)
print "Encrypted: %r" % d
print "Decrypted: %r" % k.decrypt(d)
assert k.decrypt(d, padmode=PAD_PKCS5) == data
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question