0

I wanted to learn how to use the TCL rc4 package .. the only documentation I can find are all just different sites with the same wiki, and the command example doesn't work.

Example:

% set keydata [binary format H* 0123456789abcdef]
% rc4::rc4 -hex -key $keydata HelloWorld
3cf1ae8b7f1c670b612f
% rc4::rc4 -hex -key $keydata [binary format H* 3cf1ae8b7f1c670b612f]
HelloWorld

However, when I run exactly the same example, I get:

% set keydata [binary format H* 0123456789abcdef]
% rc4::rc4 -hex -key $keydata HelloWorld
3cf1ae8b7f1c670b612f
% rc4::rc4 -hex -key $keydata [binary format H* 3cf1ae8b7f1c670b612f]
48656c6c6f576f726c64

I'm not sure how the rc4 package differentiates between encryption and decryption, the actual command string is shown as:

::rc4::rc4 ?-hex? -key keyvalue ?-command lst? ?-out channel? [ -in channel | -infile filename | string ]

Also, -command is not what I'm looking for apparently, it performs completely different function. I've tries file i/o, echo's, nothing seems to work, and there definitely seems to be something missing from the documentation.

Anyone with experience using this package?

dana
  • 61
  • 6

0 Answers0