![]() |
A52HackTool 1.3.0
Turnkey & easy to use tool for cracking the GSM A5/2 cipher
|
Implementation of A5/2 keystream generation. More...
Functions | |
void | keygen_clockReg (const int index) |
Clock the specified register. | |
void | keygen_clockingUnit (int clockAll) |
Performs register clocking according to the rules of the Clocking Unit. | |
byte | keygen_getOutBit () |
Returns the current out keystream bit. | |
void | keysetup (const byte Kc[SECRETKEY_BITS], const byte frameId[FRAMEID_BITS]) |
Initializes the whole system according to the keysetup procedure. | |
void | getKeystream (byte keystream[], const int len) |
Generates the desired amount of keystream. | |
int | keygen_test () |
Autotests the key generation on a verified set. | |
Variables | |
byte | R1 [R1_BITS] |
LFSRs Storage (as global variables for easier exploitation) | |
byte | R2 [R2_BITS] |
LFSRs Storage (as global variables for easier exploitation) | |
byte | R3 [R3_BITS] |
LFSRs Storage (as global variables for easier exploitation) | |
byte | R4 [R4_BITS] |
LFSRs Storage (as global variables for easier exploitation) |
Implementation of A5/2 keystream generation.
Here are located the methods used for simulating the behavior of the A5/2 keystream generator. Four LFSRs are used... TODO: Write some more documentation
void getKeystream | ( | byte | keystream[], |
const int | len | ||
) |
Generates the desired amount of keystream.
[out] | keystream | Keystream to be generated |
[in] | len | desired amount of keystream bits |
References keygen_clockingUnit(), and keygen_getOutBit().
Referenced by attack_test(), keygen_test(), main(), and matrices_generation_test().
void keygen_clockingUnit | ( | int | clockAll | ) |
Performs register clocking according to the rules of the Clocking Unit.
[in] | clockAll | When non-zero, bypass Clocking Unit decision: always clock (initialization phase) |
References keygen_clockReg(), MAJORITY, R4, R4_CLOCKTAP_R1, R4_CLOCKTAP_R2, and R4_CLOCKTAP_R3.
Referenced by getKeystream(), and keysetup().
void keygen_clockReg | ( | const int | index | ) |
Clock the specified register.
[in] | index | Register to be clocked |
References DEBUG, R1, R1_BITS, R1_SHIFTTAP_1, R1_SHIFTTAP_2, R1_SHIFTTAP_3, R1_SHIFTTAP_4, R2, R2_BITS, R2_SHIFTTAP_1, R2_SHIFTTAP_2, R3, R3_BITS, R3_SHIFTTAP_1, R3_SHIFTTAP_2, R3_SHIFTTAP_3, R3_SHIFTTAP_4, R4, R4_BITS, R4_SHIFTTAP_1, and R4_SHIFTTAP_2.
Referenced by keygen_clockingUnit().
int keygen_test | ( | ) |
Autotests the key generation on a verified set.
References DEBUG, FRAMEID_BITS, getKeystream(), keysetup(), and SECRETKEY_BITS.
Referenced by main().
Initializes the whole system according to the keysetup procedure.
[in] | Kc | Secret Key |
[in] | frameId | Frame Id |
References FRAMEID_BITS, keygen_clockingUnit(), R1, R1_BITS, R1_INITIAL_CONST_POS, R2, R2_BITS, R2_INITIAL_CONST_POS, R3, R3_BITS, R3_INITIAL_CONST_POS, R4, R4_BITS, R4_INITIAL_CONST_POS, and SECRETKEY_BITS.
Referenced by attack_test(), keygen_test(), main(), and matrices_generation_test().