Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

tcllib 1.9 DES package and tcl 8.5
Hello,

I have a problem with the tcllib 1.9 DES package used with tcl 8.5.

If I use the following, discrepancies between the orignal and the en-/
decrypted text appears:

% set microseconds  [expr {wide([clock clicks -microseconds])}];
1187952939896309
% set asciiData     "Hello World!"
% set encryptedData [::DES::des -mode cbc -dir encrypt -key
$microseconds $asciiData]
??+=C7my?-=AC*?+=A6$-=A6?-=E2-=A6B
% set decryptedData [::DES::des -mode cbc -dir decrypt -key
$microseconds $encryptedData]
Hello World!+=C7+=C7+=C7+=C7

Is this a known behaviour in tcl 8.5, or should I file a bug?

Best regards,

Martin Lemburg


Report this thread to moderator Post Follow-up to this message
Old Post
MartinLemburg@UGS
08-24-07 01:10 PM


Re: tcllib 1.9 DES package and tcl 8.5
From the des man page:


DES is a 64-bit block cipher. This means that the data must be provided
in units that are a multiple of 8 bytes.

Add sufficient spaces. to pad this to 16 bytes from the 12 bytes you are
passing...(each of the +Ç is a byte evidently.. they
represent the 4 chars junk in the encryption buffer probably.

Note that this will be true of many modern encryption algorithms
(that they operate on fixed sized blocks, and will need explicit
padding).


Ron

MartinLemburg@UGS wrote:
> Hello,
>
> I have a problem with the tcllib 1.9 DES package used with tcl 8.5.
>
> If I use the following, discrepancies between the orignal and the en-/
> decrypted text appears:
>
>     % set microseconds  [expr {wide([clock clicks -microseconds])}];
>     1187952939896309
>     % set asciiData     "Hello World!"
>     % set encryptedData [::DES::des -mode cbc -dir encrypt -key
> $microseconds $asciiData]
>     ??+Çmy?-¬*?+¦$-¦?-â-¦B
>     % set decryptedData [::DES::des -mode cbc -dir decrypt -key
> $microseconds $encryptedData]
>     Hello World!+Ç+Ç+Ç+Ç
>
> Is this a known behaviour in tcl 8.5, or should I file a bug?
>
> Best regards,
>
> Martin Lemburg
>

Report this thread to moderator Post Follow-up to this message
Old Post
Ron Fox
08-24-07 01:10 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:04 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.