Content-type: text/html
Manpage of TclDESjr
TclDESjr
Section: Tcl DES Library (n)
Updated: FEBRUARY 2003
Index
Return to Main Contents
NAME
TclDESjr - Tcl-based Data Encryption Standard library
SYNOPSIS
package require tclDESjr ?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
TclDESjr is a pure-Tcl implementation of the NIST Data Encryption
Standard (DES). The package can perform encryption and decryption using
the standard DES 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. TclDESjr is licensed under the same
Open Source license as Tcl (BSD). Details can be found in the TclDESjr
source code.
The TclDESjr 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 algorithm. The input
key must be a binary string of 8 bytes in length. 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 subkeys used by the
DES algorithm. The input key must be a binary string of 8 bytes in
length. The output is a list of subkeys 16 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, Tcl, package
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- COMMANDS
-
- AUTHOR
-
- SEE ALSO
-
- KEYWORDS
-
This document was created by
man2html,
using the manual pages.
Time: 05:43:47 GMT, March 03, 2003