|
Asper Header
1.0.14
The header injector extension
|
Simplified implementation of the Enigma machine polyalphabetic cipher. More...


Public Member Functions | |
| constructor (rotors:string[]=["EKMFLGDQVZNTOWYHXUSPAIBRCJ", "AJDKSIRUXBLHWTMCQGZNPYFVOE", "BDFHJLCPRTXVZNYEIWGAKMUSQO"], reflector:string="YRUHQSLDPXNGOKMIEBFZCWVJAT") | |
| Constructor for Enigma cipher. | |
Data Fields | |
| readonly | CipherName = "Enigma" |
| Identifier name for this cipher. | |
| rotors | : string[] |
| Array of rotor substitution alphabets. | |
| reflector | : string |
| Reflector alphabet for the return path. | |
| positions | : number[] |
| Current positions of each rotor (0-25) | |
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. | |
Simplified implementation of the Enigma machine polyalphabetic cipher.
Simulates the Enigma's rotor mechanism where each keypress advances the rotors, creating a different substitution alphabet for each character. Uses multiple rotors with stepping mechanism and a reflector.
|
inline |
Constructor for Enigma cipher.
| rotors | Array of rotor substitution alphabets (default: 3 historical rotors) |
| reflector | Reflector substitution alphabet (default: historical reflector B) |
Initializes the Enigma machine with specified rotors and reflector. All rotors start at position 0.
| rotors EnigmaCipher::__pad0__ |
| reflector EnigmaCipher::__pad1__ |
| positions EnigmaCipher::__pad2__ |
| readonly EnigmaCipher::CipherName = "Enigma" |