Reference
Learn RSA
A compact guide to the moving parts behind this toolkit.
RSA
RSA is an asymmetric cryptosystem: a public key can encrypt, while the corresponding private key can decrypt. The two keys are mathematically related, but the private key must remain secret.
RSA-2048 & OAEP
A 2048-bit modulus describes the size of the RSA mathematical key. OAEP is a randomized padding scheme designed for RSA encryption. It is preferred over PKCS#1 v1.5 for new encryption applications.
Hashes, bytes, and Base64
SHA-256 is a cryptographic hash function and part of the OAEP configuration; it is not the encryption algorithm. Plaintext is encoded as UTF-8 bytes before encryption: A → UTF-8 → 0x41 → 65 decimal. Unicode characters may require multiple bytes. Ciphertext is binary, so Base64 makes it printable. Base64 does not provide security or encryption.
OAEP vs PKCS#1 v1.5
| Property | OAEP | PKCS#1 v1.5 |
|---|---|---|
| Padding | Modern randomized encoding | Older padding scheme |
| Hash | Explicit OAEP/MGF configuration | No OAEP hash |
| Guidance | Preferred for new encryption | Use only for compatibility |
Security notes
- Everything in this toolkit happens locally in the browser.
- Never share private keys. Use HTTPS when deploying.
- RSA is for small messages or key wrapping, not large files. Hybrid encryption uses AES-GCM for data and RSA-OAEP for the AES key.
- Confirm key format, padding, hash, MGF hash, encoding, and compatibility with the receiving system.
- SHA-1 is legacy and not recommended for new designs.
Hybrid encryption
A future extension could use AES-GCM to encrypt large data, then RSA-OAEP to encrypt the AES key. RSA has a strict plaintext size limit because padding and the modulus consume space.