A52HackTool 1.3.0
Turnkey & easy to use tool for cracking the GSM A5/2 cipher
attack.h
Go to the documentation of this file.
00001 /*============================================================================*
00002  *                                                                            *
00003  *                                   attack.h                                 *
00004  *                                                                            *
00005  *============================================================================*
00006  *                                                                            *
00007  * Part of A52HackTool                                                        *
00008  *                                                                            *
00009  * Copyright © 2011   -   Nicolas Paglieri   &   Olivier Benjamin             *
00010  * All rights reserved.                                                       *
00011  *                                                                            *
00012  * Contact Information:  nicolas.paglieri [at] ensimag.fr                     *
00013  *                       olivier.benjamin [at] ensimag.fr                     *
00014  *                                                                            *
00015  *============================================================================*
00016  *                                                                            *
00017  * This file may be used under the terms of the GNU General Public License    *
00018  * version 3 as published by the Free Software Foundation.                    *
00019  * See <http://www.gnu.org/licenses/> or GPL.txt included in the packaging of *
00020  * this file.                                                                 *
00021  *                                                                            *
00022  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE    *
00023  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  *
00024  *                                                                            *
00025  *============================================================================*/
00026 
00037 #ifndef _ATTACK_H_
00038 #define _ATTACK_H_
00039 
00040 #include "const_A52.h"
00041 #include "const_code.h"
00042 
00043 
00044 // Attack related constants
00045 
00047 #define SYNDROME_EMPTY_EQUATIONS (NEEDED_ENCRYPTED_MESSAGES*SYNDROME_LENGTH - REGS_TOTAL_VARS)
00048 
00049 
00050 
00051 
00059 typedef struct {
00060     byte cipherText1[CODEWORD_LENGTH]; 
00061     byte cipherText2[CODEWORD_LENGTH]; 
00062     byte cipherText3[CODEWORD_LENGTH]; 
00063     byte frameId[FRAMEID_BITS];        
00064 } cipherTextArgs;
00065 
00066 
00067 
00068 
00079 typedef struct {
00080     cipherTextArgs* ctArgs;         
00081     int lowindex;                   
00082     int highindex;                  
00083     int *keyFound;                  
00084     byte secretKey[SECRETKEY_BITS]; 
00085 } threadArgs;
00086 
00087 
00088 
00089 
00094 void freeRAM();
00095 
00096 
00097 
00098 
00106 int initializeRAM(const char* filename);
00107 
00108 
00109 
00110 
00119 int attack(cipherTextArgs* ctArgs, byte secretKey[SECRETKEY_BITS]);
00120 
00121 
00122 
00123 
00130 int attack_test();
00131 
00132 
00133 
00134 
00135 #endif