C
C
cadmy2013-11-14 15:40:39
Information Security
cadmy, 2013-11-14 15:40:39

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

2 answer(s)
P
peter_volkov, 2013-11-20
@cadmy

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

W
wartur, 2013-11-14
@wartur

Again kindergarten for a walk. http://ru.wikipedia.org/wiki/DES

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question