bifid - Create and manipulate a bifid cipher


set cipherProc [cipher create bifid]

cipherProc configure ?options?
cipherProc cget option
cipherProc restore key
cipherProc substitute row col pt
cipherProc undo string


cipherProc configure ?options?
Configure the settings for the bifid cipher. Valid options are:

cipherProc configure -ciphertext string
cipherProc configure -ct string
Set the ciphertext for this cipher instance to string. Invalid letters or numbers in the ciphertext are silently discarded.

cipherProc configure -period n
Set the period for this cipher to n.

cipherProc configure -language language
This option is currently ignored for all cipher types. Set the current cipher language to language. If the cipher has a solve method then digram frequencies for this language are used to determine the best fit. If the language is not specified or not known then english is used.

cipherProc cget option
Look up the value for a given option. Valid options are:

cipherProc cget -type
Returns the type of this cipher. In this case, bifid

cipherProc cget -ciphertext
cipherProc cget -ct
Return the ciphertext for this cipher.

cipherProc cget -plaintext
cipherProc cget -pt
Return the plaintext for this cipher based on the current key setting.

cipherProc cget -bifidtext
Undocumented feature

cipherProc cget -key
Returns the current key setting for this cipher. The result can be passed back to this cipher instance or another cipher with the cipherProc restore subcommand.

cipherProc cget -length
Returns the length of the ciphertext for this cipher. 0 is returned if the ciphertext has not been set.

cipherProc cget -period
Return the period for this cipher.

cipherProc cget -language
Returns the name of the language used for this cipher.

cipherProc restore key
The restore command restores the cipher's key to a previously stored state. The output from cipherProc cget -key can be passed back into the restore command to implement a crude save feature. Example:

set key [$firstCipher cget -key]
$secondCipher restore $key

cipherProc substitute row col pt
Substitute the plaintext letter pt into the keysquare position identified by row and col. pt. An invalid row, column, or pt value will generate an error.

cipherProc undo ct
Clears all key entries for the given ciphertext values.

Back to the Index
Created on Wed Mar 31 08:18:24 PST 2004 Logo