Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

This repository contains starter code and resources for Social Coding workshops covering 1-off fun subjects like generative art, coding competitions, code reading sessions or pseudocoding.

**Group name: Salle 8**
**Group members:** - Dadi Ishimwe
- Robel Mengsteab
- Safa Saber
- Louis Kervens Hubert
- M Jawid Mohseni
- Mohamed El - nageeb
- Franklyn Abanihe
- Mariia Ermishina

## Running Python Files in this Repository

- **Running a plain Python script**:
Expand Down
29 changes: 29 additions & 0 deletions challenges/challenge1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
"""
Created on Thu Jan 30 15:30:30 2025

Group name: Salle 8
Group members: Dadi Ishimwe
Robel Mengsteab
Safa Saber
Louis Kervens Hubert
M Jawid Mohseni
Mohamed El - nageeb
Franklyn Abanihe
Mariia Ermishina

@author: somai
Challenge 1: Detecting Suspicious Login Attempts
Objective:
Expand All @@ -26,3 +36,22 @@
Interpret what the final expression means in the context of allowing or blocking a login attempt.

"""
#¬(A∧(B∨¬B))
#¬(A∧(True))
#¬(A∧(1))
#¬(A)

# the authentication system is blocked by incorrect login credentials and not whether the device is trusted or not.
def check_login(A, B):
"""
A: Correct credentials
B: Trusted device
Returns: Whether login should be blocked
"""
return not A # Simplified from ¬(A∧(B∨¬B))

# Test cases
print("Credentials correct, trusted device:", check_login(True, True))
print("Credentials correct, untrusted device:", check_login(True, False))
print("Credentials wrong, trusted device:", check_login(False, True))
print("Credentials wrong, untrusted device:", check_login(False, False))
34 changes: 34 additions & 0 deletions challenges/challenge2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
"""
Created on Thu Jan 30 15:30:30 2025

Group name: Salle 8
Group members: Dadi Ishimwe
Robel Mengsteab
Safa Saber
Louis Kervens Hubert
M Jawid Mohseni
Mohamed El - nageeb
Franklyn Abanihe
Mariia Ermishina


@author: somai
Challenge 2: Digital Access Control
Objective
Expand Down Expand Up @@ -29,3 +40,26 @@
# -*- coding: utf-8 -*-

"""
finance_access = {"E0435", "E1021", "E3098", "E7642", "E8873", "E6590"}
tech_access = {"E7642", "E8873", "E6590", "E9812", "E4520"}

# 1 - finance_access OR tech_access
at_least_one = finance_access | tech_access

# 2 - Team = finance_access AND tech_access
both_access = finance_access & tech_access

# 3 - finance_access_exclusive {"E0435", "E1021", "E3098"}
exclusive_finance = finance_access - tech_access

# 3 - tech_access_exclusive {"E9812", "E4520"}
exclusive_tech = tech_access - finance_access

# 4 - no_access = new_employee E9999
all_employees = {"E0001", "E9999", "E0435", "E1021", "E3098", "E7642", "E8873", "E6590", "E9812", "E4520"}
no_access = all_employees - (finance_access | tech_access)

# 5 - overlap_risk = finance_access AND tech_access
overlap = finance_access & tech_access

# The should not share common dates and Grant employees only the access they absolutely need to perform their job duties.
31 changes: 31 additions & 0 deletions challenges/challenge3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
Created on Thu Jan 30 15:30:30 2025

@author: somai

Group name: Salle 8
Group members: Dadi Ishimwe
Robel Mengsteab
Safa Saber
Louis Kervens Hubert
M Jawid Mohseni
Mohamed El - nageeb
Franklyn Abanihe
Mariia Ermishina

Challenge 3: Access Visualization
Objective
Develop a visual representation of the company's access control system to identify patterns, overlaps, and security risks.
Expand All @@ -20,3 +31,23 @@
Are there risks? Indicate employees who might be exposed to unnecessary data.
Your output should visually highlight these relationships without explicitly listing them in a simple table or list. Think beyond just printing data—use a format that helps detect patterns at a glance.
"""
import matplotlib.pyplot as plt
from matplotlib_venn import venn2

# Employee access data
finance_access = {"E0435", "E1021", "E3098", "E7642", "E8873", "E6590"}
tech_access = {"E7642", "E8873", "E6590", "E9812", "E4520"}
all_employees = {"E0001", "E9999", "E0435", "E1021", "E3098", "E7642", "E8873", "E6590", "E9812", "E4520"}

# Determine employee groups
only_finance = finance_access - tech_access
only_tech = tech_access - finance_access
both_access = finance_access & tech_access
no_access = all_employees - (finance_access | tech_access)

# Create Venn diagram
plt.figure(figsize=(6, 6))
venn = venn2(subsets=(len(only_finance), len(only_tech), len(both_access)), set_labels=("Finance Access", "Tech Access"))
plt.title("Employee Access Visualization")
plt.annotate(f"Employees with no access: {len(no_access)}", xy=(0.5, 0.1), xycoords="axes fraction", ha="center", fontsize=12)
plt.show()