hcrypto.engines
Class TranspositionKey
java.lang.Object
|
+--hcrypto.cipher.HistoricalKey
|
+--hcrypto.engines.TranspositionKey
- public class TranspositionKey
- extends HistoricalKey
This class represents a key for a Transposition cipher. The key
is entirely represented by a keyword, a String with a set of positive contiguous
integers always including zero: such as "2013".
For this implementation of Transposition cipher any of the alphabet ranges
can be used.
See also:
TranspositionKey
Alphabet
Method Summary |
java.lang.String |
getAlgorithm()
Returns the name of the algorithm "Transposition". |
java.lang.String |
getInvertedKeyword()
Returns the inverted keyword. |
void |
init(java.lang.String keyspec)
Initializes the TranspositionKey with the specified keyspec. |
Methods inherited from class hcrypto.cipher.HistoricalKey |
getAlphabet, getBlocksize, getCiphAlphabet, getCTAlphabet, getInstance, getKeyDescriptorPrompt, getKeyword, getPlainAlphabet, initAlphabets, initKey, printAlphabets, removeDuplicateChars |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_KEY_DESCRIPTOR_PROMPT_STRING
public static final java.lang.String DEFAULT_KEY_DESCRIPTOR_PROMPT_STRING
- A keyword description.
DEFAULT_KEYWORD_STRING
public static final java.lang.String DEFAULT_KEYWORD_STRING
- A default key.
TranspositionKey
public TranspositionKey()
init
public void init(java.lang.String keyspec)
throws java.lang.Exception
- Initializes the TranspositionKey with the specified keyspec.
- Overrides:
init
in class HistoricalKey
- Parameters:
keySpec
- takes the form "keyword/alphabet", i.e. "2013/azAZ09" for example,
which would be mapped into the instance variables keyword as a String with the value of "2013",
and alphabet as a String with the value "azAZ09".
getAlgorithm
public java.lang.String getAlgorithm()
- Returns the name of the algorithm "Transposition".
- Overrides:
getAlgorithm
in class HistoricalKey
getInvertedKeyword
public java.lang.String getInvertedKeyword()
- Returns the inverted keyword.