Download the PHP package tankfairies/enigma without Composer
On this page you can find all versions of the php package tankfairies/enigma. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tankfairies/enigma
More information about tankfairies/enigma
Files in tankfairies/enigma
Package enigma
Short Description Enigma Engine
License MIT
Homepage https://tankfairies.com/
Informations about the package enigma
Enigma
Installation
Install with Composer:
Details
This package provides the funtionality of 3 different Enigma models:
- Wehrmacht / Luftwaffe 3 rotor model
- Kriegsmarine 3 rotor model
- Kriegsmarine 4 rotor model
Each model can be equipped with a different set of rotors and refelctors. All in all are 10 types of rotors and 4 types of refelctors available.
- Wehrmacht / Luftwaffe 3 rotor model uses:
- rotors: I, II, III, IV, V
- reflectors: B, C
- Kriegsmarine 3 rotor model uses:
- rotors: I, II, III, IV, V, VI, VII, VIII
- reflectors: B, C
- Kriegsmarine 4 rotor model uses:
- rotors: I, II, III, IV, V, VI, VII, VIII, Beta, Gamma
- reflectors: B Thin, C Thin
Each rotor and reflector provides a unique wiring, which can not be changed. Settings are:
- Contacts = ABCDEFGHIJKLMNOPQRSTUVWXYZ
- I = EKMFLGDQVZNTOWYHXUSPAIBRCJ
- II = AJDKSIRUXBLHWTMCQGZNPYFVOE
- III = BDFHJLCPRTXVZNYEIWGAKMUSQO
- IV = ESOVPZJAYQUIRHXLNFTGKDCMWB
- V = VZBRGITYUPSDNHLXAWMJQOFECK
- VI = JPGVOUMFYQBENHZRDKASXLICTW
- VII = NZJHGRCXMYSWBOUFAIVLPEKQDT
- VIII = FKQHTLXOCBJSPDZRAMEWNIUYGV
- Beta = LEYJVCNIXWPBQMDRTAKZGFUHOS
- Gamma = FSOKANUERHMBTIYCWLQPZXVGJD
- B = YRUHQSLDPXNGOKMIEBFZCWVJAT
- C = FVPJIAOYEDRZXWGCTKUQSBNMHL
- B Thin = ENKQAUYWJICOPBLMDXZVFTHRGS
- C Thin = RDOBJNTKVEHMLFCWZAXGYIPSUQ
- Contacts = ABCDEFGHIJKLMNOPQRSTUVWXYZ
Rotors can have notches, which indicate the position where the next rotor is advanced. e.g.: Notch at position Q means, if rotor steps from Q to R, the next rotor is advanced. These positions are:
- I = Q
- II = E
- III = V
- IV = J
- V = Z
- VI, VII, VIII = Z + M
Each Rotor can be only used in one position at a time. Rotors I..VIII can be mounted at position 1, 2 or 3, wherelse rotors Beta and Gamma can only be used at position 4. Aditionally, Beta and Gamma can only be used in combination with reflector B Thin or C Thin, the others only with reflector B or C.
IMPORTANT
These conditions only apply if a proper emulation of the original Enigma is desired. This implementation allows to setup the rotors in any order, so its up to the user to take care of the order of rotors.
Usage
Instantiate a new instance of the library:
Reflectors
Rotors
Code Example
Further Reading
http://en.wikipedia.org/wiki/Enigma_machine
http://users.telenet.be/d.rijmenants/
Credit
Thanks to Rafal Masiarek from Mustache Lab, as this was the inspiriation for this project. https://github.com/MustacheLab/PHP-Enigma
Copyright and license
The tankfairies/rulesengine library is Copyright (c) 2021 Tankfairies (https://tankfairies.com) and licensed for use under the MIT License (MIT).