3dcf71e303ca4c39517f714b1616c2430dd89a3f
3 * It uses GMPxx lib and C++11.
4 * It needs the RNG file "/dev/urandom".
6 * Author: Grégory Burri
17 const uint KEY_SIZE_BITS
= 1024;
18 const uint RSA_PUBLIC_EXPONENT
= 65537;
20 void printUsage(const string
& progName
)
22 cout
<< "Usage: " << progName
<< " <command>" << endl
;
23 cout
<< " <command> can be one of the following:" << endl
;
24 cout
<< " * tests: Do some tests for RSA and RSA-CRT" << endl
;
25 cout
<< " * time-measures: Compute the ratio between RSA and RSA-CRT" << endl
;
26 cout
<< " * attack: Simulate the Boneh-DeMillo-Lipton attack against RSA-CRT" << endl
;
27 cout
<< " * attack-fixed: [TODO]" << endl
;
30 int main(int argc
, char** argv
)
33 for (int i
= 0; i
< argc
; i
++)
34 args
.push_back(string(argv
[i
]));
36 if (args
.size() >= 2 && args
[1] == "tests")
37 Tests(KEY_SIZE_BITS
, RSA_PUBLIC_EXPONENT
).runTests();
38 else if (args
.size() >= 2 && args
[1] == "time-measures")
39 Tests(KEY_SIZE_BITS
, RSA_PUBLIC_EXPONENT
).runTimeMeasures();
40 else if (args
.size() >= 2 && args
[1] == "attack")
41 Tests(KEY_SIZE_BITS
, RSA_PUBLIC_EXPONENT
).doAttack();