|
Asper Header
1.0.14
The header injector extension
|
Implementation of the Affine substitution cipher. More...


Public Member Functions | |
| constructor (a:number=5, b:number=8) | |
| Constructor for Affine cipher. | |
Data Fields | |
| readonly | CipherName = "Affine" |
| Identifier name for this cipher. | |
Data Fields inherited from BaseCipher | |
| abstract abstract encode(plaintext:string, key?:any) abstract decode(ciphertext:string, key?:any) readonly | CipherName: string |
| Abstract method to encode plaintext. | |
Additional Inherited Members | |
Static Public Attributes inherited from BaseCipher | |
| static readonly | ALPHABET: string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| Standard English alphabet for cipher operations. | |
Implementation of the Affine substitution cipher.
Uses linear mathematical transformation E(x) = (ax + b) mod 26 where 'a' is the multiplicative key (must be coprime to 26) and 'b' is the additive key. This provides more complexity than simple Caesar cipher.
|
inline |
Constructor for Affine cipher.
| a | Multiplicative key (default: 5, must be coprime to 26) |
| b | Additive key (default: 8) |
| Error | if 'a' is not coprime to 26 |
Initializes the cipher with the given coefficients. The multiplicative coefficient 'a' must be coprime to 26 to ensure the cipher is reversible.
| readonly AffineCipher::CipherName = "Affine" |