Encrypt.rsa_encrypt

securefile.Encrypt.rsa_encrypt()

Encrypt a plain text with RSA algorithm. ( rsa_algorithm )

Example:

from securefile import Encrypt
from securefile.keyset import RSA_KEY
rsa_private_key = RSA_KEY.private_key_genrate(6861, 57067)
enc = Encrypt('make.txt')
enc.open()
enc.rsa_encrypt(rsa_private_key)
enc.close()
Parameters:
  • key (RSA_KEY) – Encryption key.
  • commit=False (bool) – Save the change or not.
Returns:

Encrypted Message or Cipher Text.

Raises:

None

Warning

  • Emojy may change in RSA
  • RSA returns big number as encrypted text, It is good to use this at last layer of model in order to make encryption fast.