ius/rsatool

rsatool can be used to calculate RSA and RSA-CRT parameters

Python

1,677

33 commits

updated Jul 20, 2026

See the code

README

Description

rsatool calculates RSA (p, q, n, d, e) and RSA-CRT (dP, dQ, qInv) parameters given either two primes (p, q) or modulus and private exponent (n, d).

Resulting parameters are displayed and can optionally be written as an OpenSSL compatible DER or PEM encoded RSA private key.

Requirements

Usage examples

Supplying modulus and private exponent, PEM output to key.pem:

python rsatool.py -f PEM -o key.pem -n 13826123222358393307 -d 9793706120266356337

Supplying two primes, DER output to key.der:

python rsatool.py -f DER -o key.der -p 4184799299 -q 3303891593

ius/rsatool

rsatool can be used to calculate RSA and RSA-CRT parameters

Python

1,677

33 commits

updated Jul 20, 2026

See the code

README

Description

rsatool calculates RSA (p, q, n, d, e) and RSA-CRT (dP, dQ, qInv) parameters given either two primes (p, q) or modulus and private exponent (n, d).

Resulting parameters are displayed and can optionally be written as an OpenSSL compatible DER or PEM encoded RSA private key.

Requirements

Usage examples

Supplying modulus and private exponent, PEM output to key.pem:

python rsatool.py -f PEM -o key.pem -n 13826123222358393307 -d 9793706120266356337

Supplying two primes, DER output to key.der:

python rsatool.py -f DER -o key.der -p 4184799299 -q 3303891593

Significant stargazers

David Wong

1,232 followers · starred Aug 2016

Yan Shoshitaishvili

2,389 followers · starred May 2015

Predrag Gruevski

776 followers · starred Mar 2016

METO

1,115 followers · starred Oct 2017