### Luís Ramalho

Developer & Entrepreneur

RsaCoder encrypts or decrypts a message with given key. The RsaKey simply represents a pair of two large numbers. The RsaKeyPair represents a generated RSA key pair. Modular exponentiation is used for encryption and decryption. The total number of operations is logarithmic in the size of i or j, by combining exponents that are powers of 2. The mod n operation was applied on the intermediate results of exponentiation, to avoid excessively big numbers.