the BLAM page -- Doxygen documentation |
#include <nema.h>
Public Member Functions | |
nzNema () | |
default constructor | |
nzNema (string passwd) | |
constructor with 10-letter password | |
string | crypt (string strIn) |
encrypt or decrypt a string | |
string | crypt (nzCipherText ctext) |
encrypt or decrypt a ciphertext string | |
double | fastCrypt (string strIn) |
fast (no output) encryption of a string. Returns english-chi2. | |
double | fastCrypt (nzCipherText ctext) |
fast (no output) encryption of a ciphertext string | |
bool | kpta (const string strPlain, const string strCipher) |
known-plaintext attack, returns true if key is correct (set key first) | |
void | initState (int init[10]) |
set 10-letter password passing array of alphabetical codes [0-25] | |
void | initState (string passwd) |
set 10-letter password passing a string | |
double | getUniformChi2 () |
return uniform-random-chi2 of ciphertext | |
Private Member Functions | |
char | flow (char charIn) |
current flow from keyboard to lamps, through the wheels | |
void | stepState () |
step the rotor wheels after a keystroke | |
void | printState () |
show current 10-letter password | |
void | setInnerKey () |
set inner key (contact wheels and notch rings, from right to left!) | |
int | getWheelOffset (int wheel) |
relative positions of two adjacent contact wheels | |
Private Attributes | |
int | state [10] |
positions of the 10 rotor wheels | |
int | steps |
number of keystrokes | |
const int * | notchRings [6] |
inner key: list of notch rings | |
const int * | rotors [4] |
inner key: list of contact wheels | |
const int * | invrot [4] |
inner key: list of contact wheels (for backwards flow) | |
nzCipherText | cipher |
container for encrypted text |
|
default constructor
|
|
constructor with 10-letter password
|
|
encrypt or decrypt a ciphertext string
|
|
encrypt or decrypt a string
|
|
fast (no output) encryption of a ciphertext string
|
|
fast (no output) encryption of a string. Returns english-chi2.
|
|
current flow from keyboard to lamps, through the wheels
|
|
return uniform-random-chi2 of ciphertext
|
|
relative positions of two adjacent contact wheels
|
|
set 10-letter password passing a string
|
|
set 10-letter password passing array of alphabetical codes [0-25]
|
|
known-plaintext attack, returns true if key is correct (set key first)
|
|
show current 10-letter password
|
|
set inner key (contact wheels and notch rings, from right to left!)
|
|
step the rotor wheels after a keystroke
|
|
container for encrypted text
|
|
inner key: list of contact wheels (for backwards flow)
|
|
inner key: list of notch rings
|
|
inner key: list of contact wheels
|
|
positions of the 10 rotor wheels
|
|
number of keystrokes
|