Powerful RSA cracker for CTFs. Supports RSA, X509, OPENSSH in PEM and DER formats.
RsaCracker provides a simple interface to crack RSA keys and ciphers. With a collection of thousands of attacks, no key can survive against RsaCracker!
From crates.io:
console
cargo install rsacracker
Note: To build on windows, you need to use MSYS2. This is required because of the rug dependency. See building-on-windows for more information.
```text Usage: rsacracker [OPTIONS]
Options:
-c, --cipher Prime number p
-q From dockerhub: Or build it yourself: Licensed under either of at your option. Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions. Prime number q
-d
Examples
Uncipher a message from a public key
console
$ rsacracker --key public.pem -c 0xdeadbeef
Uncipher a message from n and e
console
$ rsacracker -c 0xdeadbeef -n 123...789 -e 65537
Uncipher a message from n, e and other known values
console
$ rsacracker -c 0xdeadbeef -n 123...789 -e 65537 --phi 123 --dp 123 --dq 123 --qinv 123 --pinv 123
Uncipher a file from a public key
console
$ rsacracker --key public.pem -f secret.txt.enc
Run a specific attack with arguments
console
$ rsacracker --attack known_phi -n 123...789 -e 65537 --phi 0xdeadbeef
Generate a private key from a public key
console
$ rsacracker --key public.pem --private
Generate a public key from e and n
console
$ rsacracker -e 65537 -n 0xdeadbeef --public
Dump private key secrets
console
$ rsacracker --key private.pem --dumpkey
$ rsacracker --key private.pem --dumpextkey
Remove password from a private key
console
$ rsacracker --key private.pem --password R54Cr4ck3R --private
Add password to a private key
console
$ rsacracker --key private.pem --addpassword R54Cr4ck3R --private
Show all factors of n
console
$ rsacracker -n 123...789 --factors
Run discrete logarithm attack: when c and e are swapped in the RSA encryption formula (e^c mod n)
console
$ rsacracker --key public.pem -c 0xdeadbeef --dlog
Docker
console
docker pull skyf0l/rsacracker
docker run -it --rm -v $PWD:/data skyf0l/rsacracker [args]
console
DOCKER_BUILDKIT=1 docker build . --file Dockerfile -t rsacracker
docker run -it --rm -v $PWD:/data rsacracker [args]
License
Contribution