From: Gerald W. L. <ger...@gm...> - 2007-11-12 15:25:05
|
Virden, Larry W. wrote: > Over at http://wiki.tcl.tk/18004 , I noticed this question: > > package require blowfish > > puts "[blowfish::blowfish -dir decrypt -key STNkeySTNkeySTNk [binary format H* [blowfish::blowfish -hex -dir encrypt -key STNkeySTNkeySTNk muukav]]] hohoho" > > same example in a more readable way: > > set pw [blowfish::blowfish -hex -dir encrypt -key STNkeySTNkeySTNk muukav] > > puts "[blowfish::blowfish -dir decrypt -key STNkeySTNkeySTNk [binary format H* $pw]] hohoho" > > Why does these only return muukav and not muukav hohoho? RS: Maybe the blowfish::blowfish result has extra \NUL bytes at the end? Tcl can stand that, but puts might terminate at a NUL byte. > > Anyone an expert on blowfish? > Larry, Your example writes 'muukav hohoho" to standard out -- the puts returns a null string. This was tested on OS X 10.5 with both the 8.4 build that comes with OS X and the 8.5b1 build from ActiveState. Did you try this yourself or did one of your developers tell you this? -- +--------------------------------+---------------------------------------+ | Gerald W. Lester | |"The man who fights for his ideals is the man who is alive." - Cervantes| +------------------------------------------------------------------------+ |