Tk Library Source Code

View Ticket
Login
Ticket UUID: 791886
Title: des: encoded and then decoded string does not match original
Type: Bug Version: None
Submitter: nobody Created on: 2003-08-20 13:08:58
Subsystem: None Assigned To: nobody
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2003-08-28 04:31:51
Resolution: Invalid Closed By: patthoyts
    Closed on: 2003-08-27 21:31:51
Description:
Hello all,




the following happens, when I try to encode and then 
decode back a given string:




set ciphertext [::DES::des -mode encode -key secret 
oliver]


set plaintext [::DES::des -mode decode -key secret 
$ciphertext]




string equal "oliver" $plaintext  --> 0 ??


string length "oliver" --> 6


string length $plaintext --> 8




The reason for this is, the string in $plaintext now have 
two more 'chars' at the end, both of hex 00.




Regards Oliver




P.S. By the way, I can't select 'des' as a category while 
submitting a bug, it's not in the dropdown list.
User Comments: patthoyts added on 2003-08-28 04:31:51:
Logged In: YES 
user_id=202636

DES operates on 64 bit blocks -- your 6 bytes of data has
been padded with nulls to 64 bits. If this matters to you
you will have to handle the padding protocol yourself.