Content-type: text/html Manpage of TclDES

TclDES

Section: Tcl DES/3DES Library (n)
Updated: FEBRUARY 2003
Index Return to Main Contents
 

NAME

TclDES - Tcl-based Data Encryption Standard library  

SYNOPSIS

package require tclDES ?0.5?

::des::des key message encrypt [mode [iv]]

::des::encrypt key plaintext [mode [iv]]

::des::decrypt key ciphertext [mode [iv]]

::des::createKeys key




 

DESCRIPTION

TclDES is a pure-Tcl implementation of the NIST Data Encryption Standard (DES). The package can perform encryption and decryption using either the standard DES algorithm or the triple-DES (3DES) algorithm. Both Electronic Code Block (ECB) and Cipher Block Chaining (CBC) modes of operation are supported. A goal is to support Cipher FeedBack (CFB) and Output FeedBack (OFB) modes as well.

This source code is being made publicly available and has been registered with the U.S. Dept. of Commerce Bureau of Industry and Security under export license exception TSU (Technology and Software Unrestricted) for export out of the United States. TclDES is licensed under the same Open Source license as Tcl (BSD). Details can be found in the TclDES source code.

The TclDES commands are contained within the namespace ::des so that working variables shared between the commands are isolated from the global namespace.  

COMMANDS

::des::des key message encrypt [mode [iv]]
The ::des::des command executes the DES/3DES algorithm. The input key must be a binary string of 8 bytes in length if the standard DES algorithm will be executed. The binary string must be 24 bytes in length if the 3DES algorithm will be executed. Message is a binary string that will either be encrypted or decrypted depending on the value of the encrypt flag. If encryption is being performed, the length of message is extended to an integral multiple of eight bytes. If decryption is being performed, the length of message must be an integral multiple of eight bytes. Encryption occurs if the encrypt flag in 1 (the default) and decryption occurs if the flag is 0. The mode flag determines the DES operation mode. The modes available are: 0 - Electronic Code Block (ECB, the default), 1 - Cipher Block Chaining (CBC). If the mode selected is CBC, a binary input vector string, iv, must be supplied. The binary string must be 8 bytes in length. The output is a binary string of the encrypted or decrypted form of message. The length of the output string is always an integral multiple of eight.
::des::encrypt key plaintext [mode [iv]]
The ::des::encrypt command is an encryption-only wrapper for the ::des::des command. The inputs key, mode, and iv are defined as described in the ::des::des command. The input plaintext is a binary string to be encrypted. If necessary, the length of plaintext is extended to an integral multiple of eight bytes. The output is a binary string of the encrypted form of plaintext. The length of the output string is always an integral multiple of eight bytes.
::des::decrypt key ciphertext [mode [iv]]
The ::des::decrypt command is a decryption-only wrapper for the ::des::des command. The inputs key, mode, and iv are defined as described in the ::des::des command. The input ciphertext is a binary string to be decrypted. The length of ciphertext must be an integral multiple of eight bytes. The output is a binary string of the decrypted form of ciphertext. The length of the output string is always an integral multiple of eight bytes.
::des::createKeys key
The ::des::createKeys command generates the 16 or 48 subkeys used by the DES and 3DES algorithms, respectively. The input key must be a binary string of 8 bytes in length if 16 subkeys are to be created. The binary string must be 24 bytes in length if 48 subkeys are to be created. The output is a list of subkeys either 16 or 24 elements in length. This command is used internally by the ::des::des command.

 

AUTHOR

Mac A. Cody <maccody at attbi dot com>

 

SEE ALSO

binary(n)

 

KEYWORDS

DES, 3DES, Tcl, package
 

Index

NAME
SYNOPSIS
DESCRIPTION
COMMANDS
AUTHOR
SEE ALSO
KEYWORDS

This document was created by man2html, using the manual pages.
Time: 05:43:35 GMT, March 03, 2003