message_cipher.rsa_encrypter module

The RSA encryption module defines the RsaEncrypter class, a concrete implementation of the Encrypter class. Uses the RSA encryption algorithm to encrypt string messages into arrays of integers.

class message_cipher.rsa_encrypter.RsaEncrypter(product: int, exponent: int)

Bases: Encrypter

RsaEncrypter performs calculations to encrypt string messages

Parameters:
  • product (int)

  • exponent (int)

encrypt(plaintext: str) list[int]

Encrypts a message using the RSA system.

Parameters:

plaintext (str) – A message to be encrypted.

Returns:

The encrypted message as an array of integers.

Return type:

list[int]