// How do I execute the Length-Based attack on an instance of AAG protocol with specific parameters?
// Generate AAG instance
AAGProtocolInstance AAG = AAGProtocolInstance::random( N , num_gens , min_len, max_len,
AliceDecompositionLength , BobDecompositionLength );
vector< Word > Sbgp_A = AAG.getAlicePublicSbgp( );
vector< Word > Sbgp_A2 = AAG.getAliceConjSbgp();
vector< Word > Sbgp_B = AAG.getBobPublicSbgp( );
// Execute the attack
LengthAttack_A2 A;
cout << "Executing algorithm : A" << A.type() << endl;
// try to find Bob' key
cout << "Start attack ... " << endl;
switch( A.findKey_LengthBased( N , Sbgp_A , Sbgp_A2 , Sbgp_B , TIME_LIMIT_SEC, cout ) ) {
case SUCCESSFULL:
cout << "Success" << endl;
break;
case FAILED:
cout << "Failed" << endl;
break;
case TIME_EXPIRED:
cout << "Time expired" << endl;
break;
}
return 0;
}