diff --git a/README.md b/README.md index 8342964..e1f250f 100644 --- a/README.md +++ b/README.md @@ -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**: diff --git a/challenges/challenge1.py b/challenges/challenge1.py index 182c032..1f38d6a 100644 --- a/challenges/challenge1.py +++ b/challenges/challenge1.py @@ -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: @@ -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)) diff --git a/challenges/challenge2.py b/challenges/challenge2.py index 504b52b..ef582de 100644 --- a/challenges/challenge2.py +++ b/challenges/challenge2.py @@ -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 @@ -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. diff --git a/challenges/challenge3.py b/challenges/challenge3.py index d20302e..7d90c6e 100644 --- a/challenges/challenge3.py +++ b/challenges/challenge3.py @@ -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. @@ -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()