RSA

Definition

RSA (Rivest-Shamir-Adleman) is a widely used asymmetric encryption algorithm that relies on the mathematical properties of large prime numbers. It is utilized for secure data transmission, digital signatures, and key exchange. RSA operates by generating a pair of keys: a public key for encryption and a private key for decryption, ensuring that only the intended recipient can access the encrypted data.

Secure Settings Example

# OpenSSL configuration for generating a secure RSA key pair
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:4096
openssl rsa -pubout -in private_key.pem -out public_key.pem

Insecure Settings Example

# OpenSSL configuration with weak RSA key size
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:1024
openssl rsa -pubout -in private_key.pem -out public_key.pem