[ Part 1 – Part 2 – Part 3 – Part 4 – Part 5 – Part 6 – Part 7 – Part 8 ]
What’s up guys?
In this part we’ll be implementing file transfer and encryption.
I use these programs on my own system and you absolutely have to be able to download and upload files in order to get anything done.
Now some of you might remember in part three I mentioned that our encrypted channel wasn’t stable enough to handle several megabytes of data without any mishaps.
Because of that, I had to implement file encryption and decryption in the client as well, since we’re already working with pyAesCrypt anyway.
This allows us to, at the very least, encrypt files locally before sending them over a standard tcp tunnel – or keep them encrypted on the system.
Like much of the functionality we’re going through here, these functions could be copied and used in other code without much hassle.
I’ve already made some posts regarding file encryption using pyAesCrypt in the blog, most notably: recursive file encryption in Python 3.
I recommend to check that one out if you haven’t seen it yet.
In any case, file encryption with pyAesCrypt is pretty straightforward. We are basically working with the following methods: