TripleDes encrypt difference python code and openssl -


i want encrpt using tripledes-cbc-pkcs5.

i testing python code , openssql encrypting.

key = md5("card")

using pydes.py:

def enc(data):     m = hashlib.md5()     m.update("card")     key = m.digest()       k = triple_des(key, cbc, "\0\0\0\0\0\0\0\0", pad=none, padmode=pad_pkcs5)     d = k.encrypt(data=data, padmode=pad_pkcs5)     return  base64.b64encode(d)   enc("b47650")  result : h93d5if6myu= 

using openssl:

> cat test  b47650 > openssl des3 -in test.file -e -a -p -nosalt -k 5dd2199ad68327cc76d583b057aee7d5 -iv 00000000   key=5dd2199ad68327cc76d583b057aee7d50000000000000000 iv =0000000000000000 mmsbm/mbxju= 

why different?


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -