Welcome to video 3 of Generating Random Data in Python. In the last video, you saw how Python and NumPy’s random
modules could prove useful in simulation and modeling. They are known as pseudo random number generators.
This same feature, however, makes them poor candidates for security.
How does randomness help us secure data? The short answer is that it helps us hide it. If you think about the children’s game hide and seek, to the seeker, the other children have chosen seemingly random places to hide.
In a similar way, random numbers can help us hide data using encryption. Encryption is used to secure data in transit, such as on a network, or at rest, such as on an encrypted hard drive.
Encryption uses an algorithm along with a key to sort of scramble the original data. The key is oftentimes randomly generated.
While there are many examples of encryption in computing, we’ll use the example of a secure web transaction, which involves both symmetric and asymmetric cryptography:
- In symmetric key cryptography, the sender uses a key to encrypt data, and the receiver uses that same key to decrypt data.
- In asymmetric key cryptography the sender and receiver use different keys, but I’we’ll cover that a little later.