des - Perform DES encryption of Tcl data
package require Tcl 8.3
package require des 0.8.1
|
This is a Tcl implementation of the Data Encryption Standard (DES) written by Jochen Loewer and based upon an implementation by Eric Young.
NOTE: this version only implements the Electronic Code Book (ECB) mode of DES. This is NOT suitable for general use encryption of large blocks or streams of data. Until Cipher Block Chaining (CBC) or Cipher/Output Feed Back (CFB / OFB) modes are implemented this should not be considered for real encryption. The Trfcrypt package has C-based implementations of these modes.
% set ciphertext [DES::des -mode encode -key $secret $plaintext] % set plaintext [DES::des -mode decode -key $secret $ciphertext] |
% set ciphertext [DES::des -mode encode -key $secret -file $filename] % set f [open $filename.des w] ; puts -nonewline $ciphertext ; close $f % set plaintext [DES::des -mode decode -key $secret -file $filename.des] |
Jochen C Loewer
md5(n), sha1(n)
DES, data integrity, encryption, security
Copyright © 2003, Jochen C Loewer