ASN.1 and X.509 certificate parser
Decode DER and PEM structures, walk the ASN.1 tree, and read certificate fields, extensions, and embedded public keys.
Open in ctfpalKeys and certificates are ASN.1 structures encoded in DER, usually wrapped in Base64 with PEM headers. When a challenge hands you a .pem file, parsing it is how you extract the modulus and exponent that the RSA attack actually needs.
The encoding is deliberately self-describing: every element carries a tag saying what it is and a length saying how far it runs, so a parser can walk the whole structure without knowing the schema. That means you can pull an integer out of an unfamiliar key format without first finding a specification for it.
From PEM to parameters
- Strip the
-----BEGIN-----and-----END-----lines and Base64 decode the middle to get DER. - Walk the DER tree: a public key is a SEQUENCE containing the algorithm identifier and a BIT STRING holding another SEQUENCE of two INTEGERs - the modulus
nand exponente. - A private key adds
d,p,q, and the CRT coefficients in the same structure. - Feed
nandeto the RSA analyzer and check whether the modulus is small, or the exponent unusual.
Related tools
RSA decryption and attack runner
Paste n, e, and c and let ctfpal choose the attack: trial division, Fermat, Pollard’s rho, Wiener, common modulus, or Hastad broadcast. Arbitrary-precision, in-browser.
Modular arithmetic and number theory toolkit
Modular inverse, Chinese remainder theorem, Tonelli-Shanks square roots, Jacobi symbols, and integer nth roots - arbitrary precision, in the browser.
Hex to text converter
Convert hexadecimal to text and back, tolerating whitespace, commas, and `0x` prefixes. Runs entirely in your browser.
Base64 decoder and encoder
Decode and encode Base64 and Base64-URL in the browser, with padding repair and automatic detection of nested encodings. Nothing is uploaded.