Encrypting and decrypting information with cryptography
In this section, we will review the cryptography
module for encrypting and decrypting data, including some algorithms such as AES.
Introduction to the cryptography module
Cryptography (https://pypi.org/project/cryptography) is a module available in the PyPI repository that you can install by means of the following command:
$ pip3 install cryptography
The main advantage that cryptography
provides over other cryptography modules such as pycryptodome
is that it offers superior performance when it comes to performing cryptographic operations.
This module includes both high-level and low-level interfaces to common cryptographic algorithms, such as symmetric ciphers, message digests, and key-derivation functions. For example, we can use symmetric encryption with the fernet
package.
Symmetric encryption with the fernet package
Fernet is an implementation of symmetric encryption and guarantees that an encrypted message...