Inspiration

Working as a TA in a system administrations course here at RIT I have found and had to troubleshoot many issues within both Linux and windows systems. During a Git lab a student accidentally did a git remove on the contents of the etc directory, causing s whole host of problems. This spawned the idea that the contents of certain files are extremely valuable and should be protected. Inspired by a SHA-40 hash function we wrote last semester we decided to try and implement our own encryption algorithm to protect these files.

What it does

Using RSA public and private keys, we generate unique keys for each encrypted file. Then we run the pre-archived file through a Caesar cipher like function using ASCII values. This process is automated by running a script and imputing the file or directory they would like to encrypt or decrypt.

How we built it

To automate this function we used a python3 script in a Rocky 8 virtual machine. After the user enters what they would like to encrypt, we archive the file or directory using the built-in "tar" function in Linux. After the file has been archived we run the file through the ASCII code shift to do it's first encryption. Next, we use previously generated RSA keys to encrypt or decrypt it based on the users selection. Then we store the keys in a previously made file, or create one if the users keys haven't been created.

Challenges we ran into

Originally we wanted to modify our previously made SHA-40 hash, but realizing how it's irreversible we decided to switch over to RSA keys. Then when trying to reverse the ASCII shift we ran into unexpected output that didn't align with the logic of the function. To try and remedy this we talked to multiple of the mentors, thinking we need a fresh set of eyes to look it over. After running it through the debugger multiple times we concluded that there may be something happening in the built-in python ASCII converting function we were using that was causing the issue. We talked to some mentors about it and they agreed. We finally discovered that a specific value would always yield the correct output, and given time constraints we decided to hardcode it so we could move forward. During the last hour or so, one of our python scripts that was previously working started to bug out, even though no changes were made to that script, leading us to spend the last hour trying to get it to work but being unsuccessful

Accomplishments that we're proud of

We are proud of the how fast and effectively we were able to implement the RSA algorithm. We are also very proud of how we were able to push through problems even though they took us hours to figure out. We pushed ourselves very far outside of our comfort zone given our skill level and accomplished more then we though we would be able to given the time.

What we learned

We learned how the RSA algorithm works and how to implement it in real world situations. We learned how to archive files in Linux and how to color output in Linux. We learned how to use SSH keys to clone a git repository into a Linux box.

What's next for Automated Encryption of User Files

Improve the encryption algorithm and add a third or fourth round to it. Find a more secure way to store the RSA keys for decryption. We would also like to find a way to log in as the root user in the script and to have the user authentication be more secure within the script. We want to figure out a way to get the ASCII shift backward to work without a hardcodes value.

Built With

Share this project:

Updates