- Which algorithm type uses the same key for encrypting and decrypting data?
Symmetric encryption.
- Which algorithm type uses two different keys, one for encryption and the other for decryption?
Public key algorithms use two different keys: one for encryption and the other for decryption. Users of this technology publish their public key, while keeping their private key secret. This enables anyone to send them a message encrypted with the public key, which only the holder of the private key can decrypt.
- Which package can we use in pycrypto to use an encryption algorithm such as AES?
from Crypto.Cipher import AES
- For which algorithm do we need to ensure that the data is a multiple of 16-bytes in length?
AES encryption.
- Which package for the cryptography module can we use for symmetric encryption?
The fernet package is an implementation of symmetric encryption and guarantees that a message that is encrypted cannot be manipulated or read without the key. Here's an example of its use:
from cryptography.fernet import Fernet
- Which algorithm is used to derive a cryptographic key from a password?
Password-Based Key Derivation Function 2 (PBKDF2). For the cryptography module, we can use the package from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
- What provides the fernet package for symmetric encryption and which method is used to generate the key?
The fernet package is an implementation of symmetric encryption and guarantees that a message encrypted cannot be manipulated or read without the key. To generate the key, we can use the following code:
from cryptography.fernet import Fernet
key = Fernet.generate_key()
- Which class provides the ciphers package symmetric encryption?
cryptography.hazmat.primitives.ciphers.Cipher
- Which method from stepic generates an image with hidden data, starting with an existing image and arbitrary data?
encode(image,data)
- Which package from pycrypto contains some hash functions that allow one-way encryption?
from Crypto.Hash import [Hash Type]