From the course: Securing Django Applications
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Unit testing zero knowledge encryption - Django Tutorial
From the course: Securing Django Applications
Unit testing zero knowledge encryption
- [Instructor] We're going to unit test the creation of a new journal entry. Recall that journal entries are encrypted on the client's side. To test Zero-knowledge encryption, we start by creating the client's side key. And we have to pad the key for this particular algorithm. And we also have to be 64 encoding a mobile app client or web browser client or desktop client can generate the private key used to encrypt this message. So this client side key outside of tests will be generated on the client side. So our plain text message will just be "hello world" and we have to encode it. And our encrypted text, which will be encrypted on the client side, using the client side key will be done like this using Fornet. You can use any other algorithm on the client side, as long as the user has that key. We also need to make sure that the encrypted text is a list of bytes. And then we're ready to assemble the rest API data…
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.