From the course: Learning Assembly Language

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Solution: Decryption function

Solution: Decryption function - Python Tutorial

From the course: Learning Assembly Language

Start my 1-month free trial

Solution: Decryption function

(upbeat music) - [Instructor] Okay, I hope you had fun with the challenge. Let's see how I coded the decryption, starting at line 117. The cipher text is already in XMM0, so we can just set EDI to the last 16 byte set of key material. And X all the cipher with it, using the offset 160 on the encryption key start address. This undoes the last encryption round. Then we set ECX up for nine rounds of decryption. Movie EDI back to the previous key material, execute AESIMC to adjust the key, and then execute the decryption to undo that round. We loop around nine times and then apply the AESDECLAST instruction to undo the initial stage of encryption. As for our encryption, we check that this has worked in this case by validating the plain text and that's all we need to do. So let's build this and execute it. And we can see it's worked. We passed both the encryption stages to demonstrate correct encryption and decryption.…

Contents