Cybersecurity Bootcamp tasks are mini projects that have helped me to get an understanding of Python. Each task below is a part of my learning and journey into python coding.
Project | Description |
---|---|
Award.py | Calculates awards for contestants in a triathlon |
Email.py | Email management system |
Password_hasher.py | Hashes passwords |
Award.py calculates if a participant is to be given an award for completing a triathlon.
The program takes the total amount of time taken for a contestant to complete each event of cycling, running and swimming and adds them together.
If the total time is within pre-defined ranges it will tell the user or contest if they have been awarded.
You can clone the project directly from this repo to your local system.
git clone https://github.com/xxxxxxxxxxxxxxx.
The .
will clone it to the current directory so make sure you are inside your project folder.
You will need Python to run the program. Download the latest version of Python here:
https://www.python.org/downloads/macos/
https://www.python.org/downloads/windows
https://www.python.org/downloads/source/
Open you terminal and go to the file where the award.py code has been saved.
To run award.py enter the following:
python3 award.py
python award.py
Once the program is running you will be prompted to privide inputs in the form of minutes taken to complete each event.
The program will then add the minutes together and compare the total to the pre-defined criteria below:
Total Score | Award |
---|---|
<= 100 | Honorary Colours |
101 <= total <= 105 | Honorary Half Colours |
106 <= total <= 110 | Honorary Scroll |
>110 | No award |
Feature | Benefit | Priority |
---|---|---|
Multiple attempts and Average Calculation | Allow users to enter times for multiple attempts and calculate the average time to determine the award. | ✅ |
Leaderboard or Ranking system | Allow users to enter their names and store their total times. Display a leaderboard showing the top performers. | ✅ |
Detailed Feedback | Provide feedback on how close the user was to achieving the next award tier. | ✅ |
Custom Award Criteria | Allow users to customize the award criteria for different types of events or levels of difficulty. | ✅ |
Time Conversion | Offer an option to input times in hours and minutes, converting them to total minutes automatically. | ❌ |
Graphical User Interface | Develop a simple GUI using libraries like Tkinter to make the program more interactive and visually appealing. | ❌ |
Email management service that allows users to view and mark emails as read.
The program populates an inbox with emails, lists emails with their subject with headings, emables users to read emails by selecting from an index and identifies unread emails.
The main purpose of this task was to learn how to use objects orientated programming concepts.
You can clone the project directly from this repo to your local system.
git clone https://github.com/xxxxxxxxxxxxxxx.
The .
will clone it to the current directory so make sure you are inside your project folder.
You will need Python to run the program. Download the latest version of Python here:
https://www.python.org/downloads/macos/
https://www.python.org/downloads/windows
https://www.python.org/downloads/source/
Open you terminal and go to the file where the award.py code has been saved.
To run email.py enter the following:
python3 email.py
python email.py
Once the program is running you will be prompted to select an action from a menu.
- Read email
- View unread emails
- Quit application
Make a selection...
Select a email to read.
In this example we have chosen the first email to read. By clicking number 1 the program displays the email content.
To view the emails that have not yet been read select number 2. In the example above we have already viewed email number one, therefore the program only shows emails 2 and 3 that are unread.
Selecting the number 3 from the menu will exit the application.
Feature | Benefit | Priority |
---|---|---|
Enhanced User Interface | Using a library like curses for a more interactive terminal interface. | ❌ |
Email Sorting | Allow sorting of emails by different criteria such as date, sender, or subject. | ✅ |
Email Deletion | Implement a search feature to find emails by subject line or sender. | ✅ |
Peristence | Save emails to a file or database so that they persist between program runs. | ✅ |
Multiple inboxes | Support multiple inboxes for different email addresses. | ❌ |
Search Function | Implement a search feature | ❌ |
Hash passwords inputted by the user.
The program prompts the user to enter a password or word they want to hash. With the use of bcrypt library the programs also adds a salt to make the password more secure.
The main purpose of this task was to learn about setting up virtual environments in Python and hashing.
You can clone the project directly from this repo to your local system.
git clone https://github.com/xxxxxxxxxxxxxxx.
The .
will clone it to the current directory so make sure you are inside your project folder.
You will need Python to run the program. Download the latest version of Python here:
https://www.python.org/downloads/macos/
https://www.python.org/downloads/windows
https://www.python.org/downloads/source/
bcrypt is a type of cryptographic algorithm used to securely store passwords. It scrambles a user's password into a unique code.
The program uses the bcrypt library to function with Python.
To download bcrypt from the home page:
https://pypi.org/project/bcrypt/
As bcrypt is not a standard library in Python, it is advisable to use a virtual enviroment in Python and download the code there. A virtual environment as a container where you can install and test different libraries without having to worry about anything affecting your global workspace (just like a sandbox). Once you’re done using it, you can simply remove the virtual environment (don’t worry, you can always create a new one if you need it).
Create a file in your computer locally where you wanto to run the program. Then create a virtual environment by typing the command below in the shell:
python3 -m venv venv
Once the environment has been created navigate the venv file and activate it by:
source venv/bin/activate
The virtual environment should start to run and the (venv) should be shown in the terminal like below:
Pip is a python package manager that allows you to download libraries that are not on the standard Python download.
Full guide on downloading pip visit:
https://packaging.python.org/en/latest/tutorials/installing-packages/
Bcrypt can now be downloaded in the virtual environment if you are on Mac OS use the command:
pip install bcrypt
On Linux and windows...
https://pypi.org/project/bcrypt/
As you are working in a virtual environment created specifically for this project, it will be useful to create a text file that lists all the dependencies for the project - such as bcrypt. This is useful because it will help you track which libraries you need in this environment at a later date. Or if you want to migrate the project to another environment later you will have a list of dependencies that you can re-download and get the program running quicker.
python3 password_hasher.py
python password_hasher.py
Once the program is running you will be prompted to type in a password.
The program will then hash and salt the password and return the newly created hashed password.
Once you have finished using the program please close the virtual environment by typing in...
deactivate
Feature | Benefit | Priority |
---|---|---|
Password Verification | Add the ability to verify if a given password matches a previously stored hashed password. | ❌ |
Multiple Hashing Algorithms | Allow users to choose between different hashing algorithms or parameters | ✅ |
Command Line Arguments | Enable the program to accept command line arguments for automation or scripting purposes. | ✅ |
Interactive Menu | Implement a simple menu to allow users to choose between hashing a new password or verifying an existing one | ✅ |
File I/O | Save hashed passwords to a file and allow the program to read and verify passwords from the file. | ❌ |