Tcl Library Source Code

View Ticket
Login
Ticket UUID: 3002617
Title: des , des-mode parameter and key padding
Type: RFE Version: None
Submitter: griou Created on: 2010-05-17 09:27:29
Subsystem: A Category Is Missing Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Open Last Modified: 2010-05-17 09:27:29
Resolution: Closed By:
    Closed on:
Description:
At the moment , the des module defines which DES mode to use based on the key length (64 bit for DES and 192 bit for 3DES) , so you have to provide a key with a right length. 
I think it'd be easier to have a parameter that let's the developer indicates which mode to use. Then if the key is to short, it should be padded with nulls to meet the required length.  Something like :
::DES::des ?  -des-mode [DES|3DES] ? -mode [ecb|cbc|cfb|ofb] ? ? -dir [encrypt|decrypt] ? -key keydata ? -iv vector ? ? -hex ? ? -weak ? ? -out channel ? ? -chunksize size ? [ -in channel | data ]
It's a method used in some other language like php , .net probably others.

The documentation is not really clear on how to use DES or 3DES, there should be something that explain that the DES mode used is based on the key length.

Gaetan