- Attacks against single key are stored in
/attacks/single_keyfolder; - Attacks against multiple keys are stored in
/attacks/multi_keyfolder; - Attacks are dynamically loaded;
- RsaCtfTool core is moved into
/libfolder; - Sage scripts are moved in
/sagefolder; - RsaCtfTool.py is just an cli parser / some output implemented. No more logic inside;
- Multi ciphers support;
- black formatting;
- New attacks : londahl and qicheng;
--dumpkeyand--extnow dump informations about each keys (public and private).
- Hastads;
- Unciphering multiple files;
- Testing multiple keys against on cipher;
- Extra informations output.
- Multiple attacks are fixed;
- Better exceptions handling;
- Code cleaning;
- Fix a lot of tests.
New RsaCtfTool architecture improve code readability and extensibility.
If you want to add an attack against a single key, just add a new file into /attacks/single_key/attack_name.py with an attack method.
Example :
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def attack(attack_rsa_obj, publickey, cipher=[]):
# Code logic here
return (None, None)- attack_rsa_obj : a reference to
lib.rsa_attack.RSAAttackinstance. it gave access to cli arguments and various informations; - publickey : a
lib.keys_wrapper.PublicKeyinstance; - cipher : a list containing each data to uncipher.
The attack method return a tuple :
(private_key, unciphered_data)
- private_key : an instance of
lib.keys_wrapper.PrivateKeyif recovered, else None. If multiple keys are recovered, return alistoflib.keys_wrapper.PrivateKey; - unciphered_data : if the attack focus on unciphering and not private key retreiving. If the private key is recovered, just return
Noneand it will be deciphered later in script. If no data is recovered, returnNone. If multiple ciphers are recovered, return alistofbytes.
If you want to add an attack against multiple keys, just add a new file into /attacks/multi_key/attack_name.py with an attack method.
Example :
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def attack(attack_rsa_obj, publickeys, cipher=[]):
# Code logic here
return (None, None)- attack_rsa_obj : a reference to
lib.rsa_attack.RSAAttackinstance. it gave access to cli arguments and various informations; - publickeys : a list of
lib.keys_wrapper.PublicKeyinstance; - cipher : a list containing each data to uncipher.
The attack method return a tuple :
(private_key, unciphered_data)
- private_key : an instance of
lib.keys_wrapper.PrivateKeyif recovered, else None. If multiple keys are recovered, return alistoflib.keys_wrapper.PrivateKey; - unciphered_data : if the attack focus on unciphering and not private key retreiving. If the private key is recovered, just return
Noneand it will be deciphered later in script. If no data is recovered, returnNone. If multiple ciphers are recovered, return alistofbytes.
Still beerware licensed :) Test, make pull requests (and issues) and add new attacks ! Keep safe & stay at home folks !