Encrypt.des_encrypt

securefile.Encrypt.des_encrypt()

Encrypt a plain text with DES algorithm.

Example:

from securefile import Encrypt
from securefile.keyset import DES_KEY
des_key = DES_KEY.genrate('12345678123456781234567812345678')
enc = Encrypt('test.md')
enc.open()
enc.des_encrypt(des_key, commit=True)
enc.close()
Parameters:
  • key (DES_KEY) – Encryption key.
  • commit=False (bool) – Save the change or not.
Returns:

Encrypted Message or Cipher Text.

Raises:

Warning

  • Emoji not supported in DES encryption it will skip if emoji encounter
  • To overcome this please use base64 encoding