SubstitutionCipher Class
Abstract base class for substitution ciphers (and substitution deciphers).
Substitution ciphers replace letters of plaintext by other letters. See Wikipedia for details.
Item Index
Methods
- _substituteCharCode
- Cipher static
- crypt
- Decipher static
Methods
_substituteCharCode
(
Number
-
input
Abstract method to substitute a single charCode.
Parameters:
-
input
NumberThe charCode to process.
Returns:
Number:
The processed charCode.
Cipher
()
SubstitutionCipher
static
Abstract method to create a cipher instance.
Returns:
SubstitutionCipher:
The Cipher.
crypt
(
Number
-
input
Template method to encrypt/decrypt strings substituting its input charCode by charCode.
Parameters:
-
input
StringThe string to process.
Returns:
Number:
The processed string.
Decipher
()
SubstitutionCipher
static
Abstract method to create a decipher instance.
Returns:
SubstitutionCipher:
The Decipher.