Tcl Library Source Code

Documentation
Login


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

NAME

blowfish - Implementation of the Blowfish block cipher

Table Of Contents

SYNOPSIS

package require Tcl 8.5 9
package require blowfish ?1.0.6?

::blowfish::blowfish ?-mode [ecb|cbc]? ?-dir [encrypt|decrypt]? -key keydata ?-iv vector? ?-out channel? ?-chunksize size? ?-pad padchar? [ -in channel | ?--? data ]
::blowfish::Init mode keydata iv
::blowfish::Encrypt Key data
::blowfish::Decrypt Key data
::blowfish::Reset Key iv
::blowfish::Final Key

DESCRIPTION

This package is an implementation in Tcl of the Blowfish algorithm developed by Bruce Schneier [1]. Blowfish is a 64-bit block cipher designed to operate quickly on 32 bit architectures and accepting a variable key length. This implementation supports ECB and CBC mode blowfish encryption.

COMMANDS

PROGRAMMING INTERFACE

MODES OF OPERATION

EXAMPLES

% blowfish::blowfish -hex -mode ecb -dir encrypt -key secret01 "hello, world!"
d0d8f27e7a374b9e2dbd9938dd04195a

set Key [blowfish::Init cbc $eight_bytes_key_data $eight_byte_iv]
append ciphertext [blowfish::Encrypt $Key $plaintext]
append ciphertext [blowfish::Encrypt $Key $additional_plaintext]
blowfish::Final $Key

REFERENCES

  1. Schneier, B. "Applied Cryptography, 2nd edition", 1996, ISBN 0-471-11709-9, pub. John Wiley & Sons.

AUTHORS

Frank Pilhofer, Pat Thoyts

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category blowfish of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.

SEE ALSO

3des, des, rc4

KEYWORDS

block cipher, blowfish, cryptography, encryption, security

CATEGORY

Hashes, checksums, and encryption

COPYRIGHT

Copyright © 2003, Pat Thoyts