RSA Keys & Encryption/Decryption
RSA asymmetric encryption tool. Supports key generation, public/private key encryption/decryption, digital signatures and verification.
Key Generation
Format Conversion (PEM ↔ Hex)
Usage
About the Algorithm
RSA is an asymmetric encryption algorithm widely used for secure data transmission, based on the mathematical difficulty of factoring large integers. Public Key: used to encrypt data or verify signatures, can be shared openly. Private Key: used to decrypt data or generate signatures, must be kept strictly confidential. Encryption/Decryption: data encrypted with the public key can only be decrypted with the private key, ensuring only the private key holder can read the message. Sign/Verify: signatures generated by the private key can be verified with the public key, proving the message was indeed sent by the private key holder and has not been tampered with.
Steps
1. Keys: select a key size (1024/2048/4096) and click "Generate Key Pair" to create PEM-formatted keys. 2. Encrypt/Decrypt: choose a padding scheme (RSA-OAEP recommended, or PKCS#1 v1.5 for compatibility), enter plaintext in the encrypt area, and use the public key to obtain Hex ciphertext. In the decrypt area, enter Hex ciphertext and use the private key to restore the plaintext (the same padding scheme must be used for both). 3. Sign/Verify: select a hash algorithm (SHA-1/SHA-256/SHA-384/SHA-512), enter the original content, and use the private key to generate a Hex signature. In the verify area, enter the original content and Hex signature, and use the public key to verify (the same hash algorithm must be used for both).
Notes
Generated keys are in PEM format by default (Base64-encoded DER data with headers and footers). Ciphertext is usually long and limited by key size (cannot encrypt very long data); it is typically combined with symmetric encryption (i.e., RSA encrypts the symmetric key). 1024-bit keys are no longer secure; 2048-bit or higher is recommended. This tool runs entirely in the browser; keys are never uploaded to the server. Generating 4096-bit keys may take a while. The PKCS#1 v1.5 padding scheme has known attacks (such as Bleichenbacher's attack) and is recommended only for compatibility with legacy systems; for new projects, use RSA-OAEP. Both ciphertext and signatures are Hex-encoded (not Base64).