symmetric#

class windtalker.symmetric.SymmetricCipher(password: Optional[str] = None)[source]#

A symmetric encryption algorithm utility class helps you easily encrypt/decrypt text, files and even a directory.

Parameters:

password – The secret password you use to encrypt all your message. If you feel uncomfortable to put that in your code, you can leave it empty. The system will ask you manually enter that later.

中文文档

对称加密器。

any_text_to_fernet_key(text: str) bytes[source]#

Convert any text to a fernet key for encryption.

input_password()[source]#

Manually enter a password for encryption on keyboard.

set_password(password: str)[source]#

Set a new password for encryption.

encrypt(binary: bytes, *args, **kwargs) bytes[source]#

Encrypt binary data.

decrypt(binary: bytes, *args, **kwargs) bytes[source]#

Decrypt binary data.