pycrypto 3DES keysize

N

Ning

I'm trying to write an IM client which sends encrypted messages to the
server. I tried to use pycrypto library, but when I came to 3DES
cypher I was confused about the keysize to use. In the standard it
said that it should be either 112 bits or 168 bits, whereas it's 16
bytes or 24 bytes in pycrypto. If I use 16 bytes key to encrypt and
send this key to the server which is expecting a 112 bits key, there'll
be a problem. How I should solve this?
 
H

hg

Ning said:
I'm trying to write an IM client which sends encrypted messages to the
server. I tried to use pycrypto library, but when I came to 3DES
cypher I was confused about the keysize to use. In the standard it
said that it should be either 112 bits or 168 bits, whereas it's 16
bytes or 24 bytes in pycrypto. If I use 16 bytes key to encrypt and
send this key to the server which is expecting a 112 bits key, there'll
be a problem. How I should solve this?

You need to account for the parity bits:
http://en.wikipedia.org/wiki/Triple_DES


If that may reassure you ;-) I use PyCrypto to "talk" to smart cards without
any problem.

hg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top