harbor run -t LiteCoder/rsa-fermat-factorization-decryptharbor download LiteCoder/rsa-fermat-factorization-decryptRecover a 2048-bit RSA private key from a vulnerable public key and decrypt an encrypted message. The RSA modulus was generated using a flawed random number generator that produces close primes, making it susceptible to Fermat's factorization attack.
/app/public_key.json - Contains RSA public key parameters and encrypted message/app/decrypted_message.txt - Contains the decrypted plaintext messageThe input file /app/public_key.json contains:
{
"n": "string (decimal integer)",
"e": "integer",
"ciphertext": "string (decimal integer)"
}
n: RSA modulus (2048-bit, product of two close primes)e: Public exponentciphertext: Encrypted message as integerWrite the decrypted plaintext message to /app/decrypted_message.txt as UTF-8 text without additional formatting or metadata.
/app/public_key.jsonn to recover prime factors p and qd using the recovered primes/app/decrypted_message.txtn is vulnerable to Fermat's factorization due to close primesm = c^d mod n