Inspiration
We just thought it would be cool to send and understand encrypted messages, for either secrets or for the paranoid. Also, We have a friend who is very uptight about his passwords. He always has a long password for his many accounts. So, we thought, how about they use the encryptor to make complicated passwords.
How We built it
The code it self is designed to be able to be easily implemented within a website (which unfortunately we did not have time to do ourselves), with that in mind, we decided to write the program in JavaScript as it would be allowed to be called directly from within Hyper Text Markup Language. The code calls on "Crypto-JS" a library (featuring encryption protocols such as SHA-1, SHA 256, SHA 384, SHA 512, MD5 , AES 128, AES 192, AES 256, and more., that can be initiated in JavaScript (if installed using "npm install crypto-js"). The code request the user to input either "encrypt" or "decrypt" as their purpose, if encrypt is chosen, it requests the user input a session passphrase (used to generate an encryption key through AES-256), it request the user input text to encrypt, then uses an alert message to display the encrypted version of the message on screen. If decrypt was chosen, it will request that the user input a message to decrypt, then the passphrase that was used to encrypt the text (referred to in the prompt box as "decryption key"). In addition, we input safeguards to ensure the functionality of our code by specify max character limits. The max text to encrypt limit is under 10000 characters, the max passphrase length is under 64 characters. The code also ensure that the user inputs text in the boxes, for example, if nothing is entered in the purpose box, the if and else if statements will evaluate to false, landing he fallback onto the else statement which displays an alert box containing an error. Additionally, is the passphrase box which if a password has a value of null, or the length of the userPassphrase is more than 64 characters, it will initiate a while loop request that the user input a viable password which will pass the code onto the else if statement, which checks if the passphrase is greater than 0 characters in length (because it has already passed the first if conditional by causing the while loop to evaluate to false, it has to be under 64 characters), if the else if evaluates to false it is passed to the else statement which creates a while loop until the user inputs a password that is greater than 0 characters in length.
Challenges We ran into
We ran into a number of challenges, but just to name a few, first, the Domain.com website would not give us a free domain (so we could create a website to implement our code on), without the addition of a credit card {even though we had entered the coupon code and selected the proper settings in accordance with the pamphlet), even though the cost was zero, and said the card would not be charged. With this issue, we chose to attempt to acquire a .tech domain, which would have worked, however, rather than auto activation, the domain had to be manually activatated, which didn't occur until 4 hours after we had requested the site. The .tech domain is in our email, great, not really. Due to our schools network filters, it blocked .tech domains by default, and our school only white listed the get.tech site, and the hackmcst.tech site, so after an additional hour of waiting for our domain to be whitelisted by the network admin, we were losing more and more time. At that point, we decided we had to move on from implement our code into a webpage, and had to actually get to the coding of the program itself. However, while we still possessed the hopes for our code to eventually be used in a website, we made sure to make it easily implementable in such. Additional challenges would be mistakes such as redeclaring a variable as opposed to redefining a variable which threw console errors for a while while we struggled to troubleshoot. Aside from that included many many infinite while loops, a couple conditional errors (using a single equal sign to compare values).
Accomplishments that We're proud of
We are proud that we got our code to function, and run optimally in few lines.
What We've learned
We learned that when it comes to troubleshooting errors, we just have to be patient. Things won't always work the first time, and it may be difficult to understand why.
What's next for The Pineapple Program
We were planning on developing this into an app, where it would look better, be easier to copy, and could have the keys saved locally. This would make the program actually marketable.
Log in or sign up for Devpost to join the conversation.