472,353 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

pycrypto 3DES keysize

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?

Dec 13 '06 #1
2 3563
hg
Ning wrote:
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


Dec 14 '06 #2
hg
hg wrote:
Ning wrote:
>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

PS: as stated in the wiki, I would seriously consider AES as it is safer /
faster / supported by pycrypto

hg
Dec 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: underwmd | last post by:
Hello, My problem is two fold. 1) I must support a deployed legacy application written in VB6 SP5. I need to export data from a database,...
1
by: Sathyaish | last post by:
I have the following scenario: Algorithm: 3DES Cipher Mode: CBC Key Size: 128-bit Block Size: 64 bit IV: 0x0000000000000000 (an eight byte...
3
by: mirandacascade | last post by:
Operating system: Win XP Vsn of Python: 2.4 Situation is this: Required to calcluate a message digest. The process for calcluating the digest...
5
by: mirandacascade | last post by:
Attempting to determine whether the PyCrypto package has the capability to perform AES256 encryption. I received the following C# snippet: ...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.