Inspiration
I want people to be safe from the constant cyber attacks going on in the world, as cyber-attacks and ransomware cost citizens billions of dollars every year. My grandparents have been the victim of a cyberattack, so I wanted to create a beginner-friendly platform for people new to cybersecurity, like them, to learn how safe they are and how they could secure themselves. In my economics class that I'm taking over the summer, I learned about a credit score, which gives you a financial safety rating out of 850, and I thought that there could also be a cyber safety score just like a credit score. During the Hackathon neural networks and AI presentation, I saw the amazing things that could be done by Chat-GPT and I wanted to implement it into my app, so I learned how to add the Chat-GPT API into my app to help users learn cybersecurity and know what they could improve on to boost their score.
What it does
The app HackScore gives the user an assessment of 25 questions that determine how safe their digital habits and tendencies are. The user can go back and change answers to questions without losing their progress. The responses are then calculated to produce a score out of 850 to determine how safe the user is. The user can then access a screen where they can ask a chatbot to help them learn about cybersecurity and improve their score.
How we built it
I first had to create the screens that the user would interact with. I created a simple, minimalistic design that is very user-friendly with clear labels and buttons to interact with. I sketched out how the app would flow from screen to screen, and what the user would interact with. I then had to determine how the app would present the user with questions, and answers, and then be able to calculate the score from the selected answers. The individual question/answer prompts are stored in an Array that is cycled through. I decided to have a single screen where the question and answer texts change whenever an answer is clicked, and the answer is stored in an ArrayList with its assigned point value. The user can go back to previous questions, as the ArrayList changes size. When the user finishes the assessment, all the values in the ArrayList that correspond to the answers chosen are added up and given to the user as their score. Then the user can access the chatbot, powered by ChatGPT's API. I looked up ChatGPT's API guide on OpenAI's website, and I also used ChatGPT to help me integrate the API into the program. I had to learn how to use basic JSON in Android Studios, so I could submit text from the user input, into the API, and then have the information sent back to the app output.
Challenges we ran into
I initially had trouble figuring out how to have the scores of the answers chosen be added up, while allowing for the user to go back to previous questions. I was trying to use an Array to keep track of the scores, but it would not work. After researching the solution on the internet, I figured out that I needed to use ArrayLists instead of Arrays to keep track of the scores since the size of the ArrayList is flexible. Integrating ChatGPT into my app was very difficult as well since I have never used an API in coding before. After many hours of research and tutorials, I gathered up the resources online that I needed to use OpenAI's API in Android Studios. Getting the text input to go to the API was very difficult, and only after using ChatGPT to help integrate itself, I was able to piece together the JSON code and have the input be received. Getting the response back from ChatGPT was also difficult as it would throw back lots of extraneous code and information along with the desired text response. After an hour of online research, I was able to receive just the desired text. The last problem came when I was getting ready to push my commit to GitHub, but my API Key was hardcoded into my code, meaning that it would be publicly exposed if I committed. I had to learn how to hide files through .gitignore in GitHub to be able to push my commit.
Accomplishments that we're proud of
I am the most proud of my ChatGPT integration into my app. I have never used an API before and using such a new technology that is so powerful made me happy and it proved to me that I could do hard things and do things that seemed impossible beforehand. I'm also proud that I was able to use what I learned in the zoom meeting during the Hackathon to improve my app in a meaningful way.
What we learned
I learned that everything is in arms reach if you just believe in yourself and push yourself hard, regardless of how impossible it seams. I never thought my app would be connected to the internet, much less use artificial intelligence to help the user.
What's next for HackScore
I have many good ideas on what HackScore does, I think that I could feed the questions and answers into the ChatGPT API to give personalized feedback to the user based on what choices they chose and what they could improve on. I also plan on finding a way for the app to email the user their results so they could have their results and information saved on their device to look back to for reference to see if their score is improving. HackScore could also have a senior mode which gives simplified questions and answers, with larger fonts and and a simpler menu, to help secure senior citizens, who are extremely at risk of cyber attacks.
Built With
- android-studio
- java
- openai
Log in or sign up for Devpost to join the conversation.