NAME

key - Perform key manipulations

SYNOPSIS

key option args

DESCRIPTION

key generate -type keyword1 ?keyword2?
Generate a keyed alphabet from a keyword or set of keywords. The type must be one of -k1, -k1list, -k2, -k2list, -k3, or -k3list. The -list types return a list of 26 keys by rotating the key through all 26 possible starting positions.

key convert type char1 char2
key convert performs vigenere, variant, beaufort, porta, and portax key conversions. type is one of the following:
vigpt
Takes a key letter and ciphertext letter as input and returns the vigenere-decoded plaintext letter. Example:

key convert vigpt b f

returns e

vigct
Takes a key letter and plaintext letter as input and returns the vigenere-encoded ciphertext letter. Example:

key convert vigct b f

returns g

vigkey
Takes a ciphertext letter and plaintext letter as input and returns the vigenere-encoded key letter. Example:

key convert vigkey b f

returns w

varpt
Takes a key letter and ciphertext letter as input and returns the variant-decoded plaintext letter. Example:

key convert varpt b f

returns g

varct
Takes a key letter and plaintext letter as input and returns the variant-encoded ciphertext letter. Example:

key convert varct b f

returns e

varkey
Takes a ciphertext letter and plaintext letter as input and returns the variant-encoded key letter. Example:

key convert varkey b f

returns e

beapt
Takes a key letter and ciphertext letter as input and returns the beaufort-decoded plaintext letter. Example:

key convert vigpt b f

returns w

beact
Takes a key letter and plaintext letter as input and returns the beaufort-encoded ciphertext letter. Example:

key convert beact b f

returns w

beakey
Takes a ciphertext letter and plaintext letter as input and returns the beaufort-encoded key letter. Example:

key convert beakey b f

returns g

prtpt
Takes a key letter and ciphertext letter as input and returns the porta-decoded plaintext letter. Example:

key convert prtpt b f

returns s

prtct
Takes a key letter and ciphertext letter as input and returns the porta-decoded plaintext letter. Example:

key convert prtpt b f

returns s. Since porta encipherment is reciprocal, the prtpt and prtct types return the same value.

prtkey
Takes a key letter and ciphertext letter as input and returns the porta-decoded plaintext letter. Example:

key convert prtpt b w

returns q

portaxct
Takes a key letter and plaintext letter pair as input and returns the portax-encoded ciphertext letter pair. Example:

key convert portaxct c bw

returns ke. Since portax encipherment is reciprocal, the types portaxct and portaxpt return the same values.

portaxpt
Takes a key letter and plaintext letter pair as input and returns the portax-encoded ciphertext letter pair. Example:

key convert portaxct c ke

returns bw. Since portax encipherment is reciprocal, the types portaxct and portaxpt return the same values.

key numtostring number
Convert the numerical argument to it's english-language equivalent. Any value less than one billion is accepted.

key numtostring 123

returns one hundred twenty three

key ordervalue string
Generate a value based on how ordered the string is. This is generally used on keyed alphabets to determine how likely that the string is a valid K1 keyed alphabet. For example, the random string qwertyuiopasdfghjklzxcvbnm gives an ordervalue of 8. The keyed alphabet logarithmbcdefjknpqsuvwxyz has an ordervalue of 16. This means that the latter is more likely to be a K1 keyed alphabet than the former.

key match string1 string2
Returns 1 or 0 based on whether or not the two keys match. Spaces are treated as wildcard characters.

key match abcdefghijklmnopqrstuvwxyz "a cdefghijklmn stuvwxyz"

returns 1, while

key match abcdefghijklmnopqrstuvwxyz "a xxxxxhijklmn stuvwxyz"

returns 0


Back to the Index
wart@kobold.org
Created on Wed Mar 31 08:18:24 PST 2004
SourceForge.net Logo