Class RSA

java.lang.Object
org.episteme.core.mathematics.cryptography.RSA

public class RSA extends Object
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)
  • Constructor Details

    • RSA

      public RSA()
  • Method Details

    • generateKeyPair

      public static RSA.KeyPair generateKeyPair(int bitLength)
      Generates RSA key pair.
      Parameters:
      bitLength - key size in bits (e.g., 2048, 4096)
      Returns:
      public and private keys
    • encrypt

      public static BigInteger encrypt(BigInteger message, RSA.PublicKey publicKey)
      Encrypts message using public key: c = m^e mod n
    • decrypt

      public static BigInteger decrypt(BigInteger ciphertext, RSA.PrivateKey privateKey)
      Decrypts ciphertext using private key: m = c^d mod n
    • sign

      public static BigInteger sign(BigInteger message, RSA.PrivateKey privateKey)
      Signs message using private key.
    • verify

      public static boolean verify(BigInteger message, BigInteger signature, RSA.PublicKey publicKey)
      Verifies signature using public key.