Encrypt.caesar_cipher

securefile.Encrypt.caesar_cipher(self, key_shift=3, commit=False)

The action of a Caesar cipher is to replace each plaintext letter with a different one a fixed number of places down the alphabet. The cipher illustrated here uses a left shift of three, so that (for example) each occurrence of E in the plaintext becomes B in the ciphertext.

Encrypt a plain text into cipher text.

Example:

from securefile import Encrypt
enc = Encrypt('test.md')
enc.open()
enc.caesar_cipher(key_shift=3, commit=True)
enc.close()
Parameters:
  • key_shift=3 (int) – Number of place to br shift.
  • commit=False (bool) – Save the change or not.
Returns list:

Encrypted Message or Cipher Text.

Raises:

None