A52HackTool 1.3.0
Turnkey & easy to use tool for cracking the GSM A5/2 cipher
Functions
keysetup_reverse.h File Reference

Specification of last attack phase on A5/2: keysetup reversal. More...

#include "const_A52.h"

Go to the source code of this file.

Functions

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.

Detailed Description

Specification of last attack phase on A5/2: keysetup reversal.

Author:
Nicolas Paglieri & Olivier Benjamin
Version:
File Revision #3
Date:
24/06/2011

Function Documentation

int keysetup_reverse_test ( )

Autotests the reversal of the keysetup on a verified set of problem/solution.

Returns:
0 if the test is successfull, non-zero otherwise

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.

Parameters:
[in]R1Status of register R1 after keysetup
[in]R2Status of register R2 after keysetup
[in]R3Status of register R3 after keysetup
[in]R4Status of register R4 after keysetup
[in]frameIdPublicly known Frame Id
[out]secretKeyRecovered secret key if the attack succeeded, all zeros otherwise
Returns:
0 if the reversal is successful, non-zero 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().