Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encryption Key Size...Pls Help!!

Status
Not open for further replies.

Forri

Programmer
Joined
Oct 29, 2003
Messages
479
Location
MT
Hi All

I am using mcrypt to encypt a string using MCRYPT_TripleDES with a key:

0123456789abcdef23456789abcdef01456789abcdef0123

and an error stating

Warning: mcrypt_ecb(): Size of key is too large for this algorithm

What can i do...its not up to me to create the key!! how can i go about it!

Thanks
Nick
 
You must use a shorter key or go to another encryption algorithm.

3DES has a key-length limit of 192 bits (assuming 8 bits per character, a maximum of 24 characters). You're handing it a 392-bit key.

Blowfish or RC4, for example, will take longer key lengths.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top