This time, however, I decided to expand on its methods and basically make an all-in-one stop for encryption / decryption.
So its something I wanted to make for my own use and figured I might as well share it with you guys. 🙂
Beware though: recursion can be dangerous if used without knowledge. You could end up encrypting your entire system. Also this script will automatically delete the old files after encryption / decryption.
Download link is at the bottom of the post!
Script Requirements
I won’t go into any details regarding the code since I’ve already made a blog post and video going into detail for this exact code.
Anyway, you will need to install pyAesCrypt. This is easiest using pip:
We’re off to part five of our little Python control server.
I had been postponing this, but its time we implement multiple clients!
I knew we had to do this right and that it would most likely bloat the scripts as well, so it would also require breaking it down into specific modules.
So yeah, that’s what we’re doing, lets get into it!
But before that, let me give you guys some context into the code…
Modular Programming
Many times when working on a project, as it begins to expand and get into a few hundred lines of code we need to start breaking it up into modules.
For our project, so far, it seems most of the functionality is divided between server configuration and data encryption.
I figure, just for the sake of development and teaching proper methods to keep working in a program without feeling like its a labyrinth, we’ll go ahead and separate our code into a few modules.
We are back with another part of our Ionic 4 card matching game.
In the previous parts we broke down the basics of the Ionic framework, did the groundwork for our little game, added some images and coded the basic functions for matching cards on-screen.
Although we have a lot of functionality in the game already we’re lacking screens for when the player loses, wins and for loading.
That’s what we’ll be working on this time.
One more twist we’ll be adding is time. Let’s give the player something like sixty seconds to match all the cards otherwise he loses.
Coding Summary
To start off we have to add a bunch of variables to support the new screens we’re adding and to control time inside our game.
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.
Recent Comments