caesar_cipher module

caesar_cipher.create_shifted_alphabet(shift: int) Dict[str, str][source]

Given a shift return a dictionary with the shifted alphabath

Example

>> new_letters = create_shifted_alphabet(shift=1) >> print(new_letters) new_letters = {“a”: “b”, “b”: “c”, …}

Parameters:

shift (int) – The number of places to shift the alphabet

Returns:

Dictionary with the original alphabet as keys and the new letters as values

Return type:

Dict[str, str]

caesar_cipher.decrypt(encrypted_message: str, shift: int) str[source]

Decrypt the encypted message using ceaser shift

Parameters:
  • encrypted_message (str) – The message that should be decrypted

  • shift (int) – The ceasr shift

Returns:

Deacrypted message

Return type:

str

caesar_cipher.encrypt(message: str, shift: int) str[source]

Encrypt message with caesar shift

Parameters:
  • message (str) – The message you want to encrypt

  • shift (int) – The cesar shift used to encrypt the message

Returns:

The encrypted message

Return type:

str

caesar_cipher.rotate_string(msg: str, shift: int) str[source]