473,287 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 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 3624
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, compress it and the encrypt the data using 3DES (to...
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 array of zeros) The results I get using .NET with...
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 must use an SHA-256 algorithm. Questions: 1) Is...
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: CryptoProvider provider = new CryptoProvider();...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.