Chapter 13: Cryptography and Steganography

 

  1. Which algorithm type uses the same key for encrypting and decrypting data?

Symmetric encryption.

 

  1. 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.

 

  1. Which package can we use in pycrypto to use an encryption algorithm such as AES?

from Crypto.Cipher import AES

 

  1. For which algorithm do we need to ensure that the data is a multiple of 16-bytes in length?

AES encryption.

  1. 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

 

  1. 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

 

  1. 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()

 

  1. Which class provides the ciphers package symmetric encryption?

cryptography.hazmat.primitives.ciphers.Cipher

 

  1. Which method from stepic generates an image with hidden data, starting with an existing image and arbitrary data?

encode(image,data)

 

  1. Which package from pycrypto contains some hash functions that allow one-way encryption?

from Crypto.Hash import [Hash Type]

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.200.71