From the course: Protecting Data for Analysis and Machine Learning
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Encryption
From the course: Protecting Data for Analysis and Machine Learning
Encryption
- [Instructor] Now let's explore the data anonymization technique called encryption. We already talked a little bit about encryption at the database level that the security team is mainly responsible for, but you can use encryption too. Encryption basically scrambles data so that a normal user can't read it without some kind of key. Does anyone remember those secret decoder rings that came in cereal boxes? Do they even still put toys in cereal boxes anymore? One way to do this is to use a symmetric encryption method, also known as a secret key used to decrypt and encrypt electronic data. For example, we'll use the Fernet model, which is part of the cryptography library. First, we'll need to generate a random secret encryption key, storing that key in a variable named key, and we'll use the Fernet.generate_key. Then we want to create a Fernet cipher object with the secret key we just generated. Similarly, we'll store this in a variable called cipher. We use the Fernet and passed it in…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.