![]() |
A52HackTool 1.3.0
Turnkey & easy to use tool for cracking the GSM A5/2 cipher
|
Implementation of last attack phase on A5/2: keysetup reversal. More...
#include <stdlib.h>#include <stdio.h>#include <string.h>#include "utils.h"#include "keysetup_reverse.h"Data Structures | |
| struct | keysetup_reverse_LFSRSet_t |
| Set of all LFSR's variables. More... | |
Typedefs | |
|
typedef keysetup_reverse_LFSRSet_t * | keysetup_reverse_LFSRSet |
| Pointer to a set of LFSR's variables. | |
Functions | |
| void | keysetup_reverse_clockRegs (keysetup_reverse_LFSRSet LFSRs) |
| Clock all registers (during the keysetup phase, the clocking unit is unused). | |
| int | reverseKeysetup (const byte R1[R1_BITS], const byte R2[R2_BITS], const byte R3[R3_BITS], const byte R4[R4_BITS], const byte frameId[FRAMEID_BITS], byte secretKey[SECRETKEY_BITS]) |
| Performs the reversal of the keysetup, retrieving the Secret Key from the LFSRs state after keysetup. | |
| int | keysetup_reverse_test () |
| Autotests the reversal of the keysetup on a verified set of problem/solution. | |
Implementation of last attack phase on A5/2: keysetup reversal.
| void keysetup_reverse_clockRegs | ( | keysetup_reverse_LFSRSet | LFSRs | ) |
Clock all registers (during the keysetup phase, the clocking unit is unused).
| [in,out] | LFSRs | Pointer to the set of LFSR's variables to clock |
References keysetup_reverse_LFSRSet_t::R1, R1_BITS, keysetup_reverse_LFSRSet_t::R2, R2_BITS, keysetup_reverse_LFSRSet_t::R3, R3_BITS, keysetup_reverse_LFSRSet_t::R4, R4_BITS, SECRETKEY_BITS, and XOR_CHARARRAYS.
Referenced by reverseKeysetup().
| int keysetup_reverse_test | ( | ) |
Autotests the reversal of the keysetup on a verified set of problem/solution.
References DEBUG, DUMP_CHAR_VECTOR, FRAMEID_BITS, R1, R1_BITS, R2, R2_BITS, R3, R3_BITS, R4, R4_BITS, reverseKeysetup(), and SECRETKEY_BITS.
Referenced by main().
| int reverseKeysetup | ( | const byte | R1[R1_BITS], |
| const byte | R2[R2_BITS], | ||
| const byte | R3[R3_BITS], | ||
| const byte | R4[R4_BITS], | ||
| const byte | frameId[FRAMEID_BITS], | ||
| byte | secretKey[SECRETKEY_BITS] | ||
| ) |
Performs the reversal of the keysetup, retrieving the Secret Key from the LFSRs state after keysetup.
| [in] | R1 | Status of register R1 after keysetup |
| [in] | R2 | Status of register R2 after keysetup |
| [in] | R3 | Status of register R3 after keysetup |
| [in] | R4 | Status of register R4 after keysetup |
| [in] | frameId | Publicly known Frame Id |
| [out] | secretKey | Recovered secret key if the attack succeeded, all zeros otherwise |
References DEBUG, FRAMEID_BITS, keysetup_reverse_clockRegs(), R1, keysetup_reverse_LFSRSet_t::R1, R1_BITS, R2, keysetup_reverse_LFSRSet_t::R2, R2_BITS, R3, keysetup_reverse_LFSRSet_t::R3, R3_BITS, R4, keysetup_reverse_LFSRSet_t::R4, R4_BITS, REGS_BITS, SECRETKEY_BITS, and XOR_CHARARRAYS.
Referenced by attack_decipherSecretKey(), and keysetup_reverse_test().
1.7.4