NodeCrypto Help

RSA Key Generator

Category: Asymmetric & Elliptic Curve ยท Node Type ID: asymmetric-rsa-keygen

Generates RSA public/private keypair (1024, 2048, 3072, 4096-bit, PEM & DER)

Overview

Generates a fresh RSA public/private keypair (PKCS#1 v2.2 / RFC 8017) of the selected modulus bit length (1024, 2048, 3072, or 4096 bits) and public exponent ($e = 65537$ or $e = 3$).

For maximum convenience across downstream nodes and external tools, the node simultaneously emits the generated keypair in both ASCII PEM format (Public Key (PEM) / Private Key (PEM) as String, using SPKI and PKCS#8 wrappers) and binary DER format (Public Key (DER) / Private Key (DER) as Bytes).

When to Use

Parameter Configuration

Parameter (ID)Type & DefaultVisibility ConditionDescription & Options
Key Size (Modulus Bits)
modulusLength
select
Default: 2048
Always visible RSA modulus size in bits: 1024 (128B, fast test only), 2048 (256B, standard), 3072 (384B, high security), or 4096 (512B, ultra security; takes longer to generate).
  • 1024: 1024-bit (Legacy / Test)
  • 2048: 2048-bit (Standard)
  • 3072: 3072-bit (High Security)
  • 4096: 4096-bit (Ultra Security)
Public Exponent (e)
publicExponent
select
Default: 65537
Always visible RSA public exponent $e$: 65537 ($2^{16}+1$, standard Fermat prime $F_4$) or 3 (legacy/educational fast verification).
  • 65537: 65537 (0x10001 - Standard F4)
  • 3: 3 (0x03 - Fast Verification)
Intended Primary Usage
usage
select
Default: encrypt
Always visible Documents the intended primary key usage context (encrypt for RSA-OAEP or sign for RSA-PSS / PKCS#1 v1.5); the generated key material works with both RSA encryption and RSA signature nodes in NodeCrypto.
  • encrypt: Encryption / Decryption (RSA-OAEP)
  • sign: Digital Signatures (RSA-PSS / PKCS#1)

Port I/O Specification

See Ports & Connections for general wiring rules, data type colors, and dynamic port creation.

Input Ports

This node has no input ports.

Output Ports

Port Nature: Fixed Output Ports (4 total).

Port NamePort IDData TypeVisibility ConditionDescription
Public Key publicKeyPem String (PEM) Always visible RSA public key formatted as a PKIX SubjectPublicKeyInfo (SPKI) PEM string (-----BEGIN PUBLIC KEY-----).
Private Key privateKeyPem String (PEM) Always visible RSA private key formatted as a PKCS#8 PrivateKeyInfo PEM string (-----BEGIN PRIVATE KEY-----).
Public Key publicKeyDer Bytes (DER) Always visible Binary ASN.1 DER encoding (Uint8Array) of the SPKI public key.
Private Key privateKeyDer Bytes (DER) Always visible Binary ASN.1 DER encoding (Uint8Array) of the PKCS#8 private key.

Error Cases

This node has no runtime failure cases (errorProfile: none) and always succeeds for any valid typed input.

Examples

Generating a 2048-bit RSA Keypair for Encryption or Signing

Create an RSA-2048 keypair and wire the DER or PEM outputs to downstream RSA nodes.

  1. Leave Key Size at 2048-bit (Standard) and Public Exponent at 65537.
  2. Connect Public Key (DER) to RSA-OAEP Encrypt and Private Key (DER) to RSA-OAEP Decrypt.