
To use the Fernet module, you need to install the cryptography package first by running the following command: pip install cryptography decrypted_data = f.decrypt(encrypted_data) Table: Methods in Python Fernet Module for Cryptography encrypted_data = f.encrypt(b”data to be encrypted”) decrypt(encrypted_data) This method retrieves the original plain text from the Fernet Token. key = Fernet.generate_key()į = Fernet(key) encrypt(data) The data is encrypted into ciphertext as a “Fernet token” which is in bytes. Method Use Case Syntax generate_key() This method is used to generate a new key. It uses three major methods to generate keys, encrypt and decrypt the data.

Hence it implements Symmetric Key Cryptography. Here, a unique key is generated without which the data cannot be read/modified. The Fernet module comes under the cryptography package. In this article, we will shed light on some modules that can be used for the encryption and decryption of data.

It essentially makes the code understandable and logically organized. Modules are files that contain Python statements and definitions for functions, classes, and variables that can be used in your program. Table: Types of Cryptography Python Modules for Cryptography Asymmetric Key Cryptography A pair of unique keys, a Public key – to encrypt and a Private key – to decrypt the messages, are used in this system. Many operating systems use hash functions to encrypt passwords, as they are completely shielded from other users.


Hash Functions A compressed fixed length notation of the message known as the hash value is generated instead of the key. This system is faster and simpler, but the key has to be shared in a secure manner. There are three widely used types of cryptography: Type of Cryptography Description Symmetric Key Cryptography It is an encryption system where the encrypting and decrypting of the messages are done using a single common key. Decryption is the process of retrieving the plain text from the cipher text using a secret key. The data is encrypted and decrypted to achieve the required confidentiality of the information.Įncryption is basically a conversion of plain text into cipher text. What is Cryptography?Ĭryptography is a lock-and-key technique that enables secure communication of information through codes that can only be accessed by the appropriate receiver. This feat of internet privacy and security is achieved using cryptography, which is a concept for your online protection. Ever wondered how your passwords are hidden? Have you thought about what the word end-to-end encryption in WhatsApp means? Did your curiosity flick, thinking about the process of online money transfer?
