Class RSA
java.lang.Object
org.episteme.core.mathematics.cryptography.RSA
RSA (Rivest-Shamir-Adleman) public-key cryptography.
Based on difficulty of factoring large semiprimes. Scientific foundation: number theory, modular exponentiation.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigIntegerdecrypt(BigInteger ciphertext, RSA.PrivateKey privateKey) Decrypts ciphertext using private key: m = c^d mod nstatic BigIntegerencrypt(BigInteger message, RSA.PublicKey publicKey) Encrypts message using public key: c = m^e mod nstatic RSA.KeyPairgenerateKeyPair(int bitLength) Generates RSA key pair.static BigIntegersign(BigInteger message, RSA.PrivateKey privateKey) Signs message using private key.static booleanverify(BigInteger message, BigInteger signature, RSA.PublicKey publicKey) Verifies signature using public key.
-
Constructor Details
-
RSA
public RSA()
-
-
Method Details
-
generateKeyPair
Generates RSA key pair.- Parameters:
bitLength- key size in bits (e.g., 2048, 4096)- Returns:
- public and private keys
-
encrypt
Encrypts message using public key: c = m^e mod n -
decrypt
Decrypts ciphertext using private key: m = c^d mod n -
sign
Signs message using private key. -
verify
Verifies signature using public key.
-