473,407 Members | 2,546 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,407 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 3630
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.