wire / wire-format / rsa

RSA (Rivest-Shamir-Adleman)

RSA is a public-key cryptosystem. Key generation: choose two large primes p, q; n = p*q; φ(n) = (p-1)(q-1); choose e (public exponent, typically 65537); d = e^(-1) mod φ(n) (private exponent). Encryption: c = m^e mod n. Decryption: m = c^d mod n. Signature: s = m^d mod n. Verify: m = s^e mod n. Padding: PKCS#1 v1.5 or OAEP (encryption), PSS (signature).

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: RSA (Rivest-Shamir-Adleman)

wire format

spec: RFC 8017 (PKCS #1)

RSA is a public-key cryptosystem. Key generation: choose two large primes p, q; n = p*q; φ(n) = (p-1)(q-1); choose e (public exponent, typically 65537); d = e^(-1) mod φ(n) (private exponent). Encryption: c = m^e mod n. Decryption: m = c^d mod n. Signature: s = m^d mod n. Verify: m = s^e mod n. Padding: PKCS#1 v1.5 or OAEP (encryption), PSS (signature).

fieldsizemeaning
Modulus (n)2048/3072/4096 bitsn = p * q. Product of two large primes.
Public exponent (e)17/32 bitsTypically 65537 (0x10001). Must be coprime to φ(n).
Private exponent (d)same as nd = e^(-1) mod φ(n) (or mod λ(n) for CRT optimization).
Prime phalf of nFirst large prime.
Prime qhalf of nSecond large prime.
CRT parametersfor fast decryptiondp = d mod (p-1), dq = d mod (q-1), qinv = q^(-1) mod p. Enables 4x faster decryption.
Encryptionoperationc = m^e mod n (modular exponentiation).
Decryptionoperationm = c^d mod n (or CRT: m1 = c^dp mod p, m2 = c^dq mod q, then CRT combine).
Padding (OAEP)for encryptionOptimal Asymmetric Encryption Padding: adds randomness and structure to prevent attacks.
Padding (PSS)for signatureProbabilistic Signature Scheme: randomized padding for signatures.

example:

00 00 00 00

RSA (placeholder)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/rsa or /wire-format/rsa.json