diff --git a/.vscode/settings.json b/.vscode/settings.json index 5f1bbc6..984f7d5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -116,5 +116,8 @@ "markdown.extension.toc.updateOnSave": false, "python.testing.unittestArgs": ["-v", "-s", ".", "-p", "test_*.py"], "python.testing.pytestEnabled": false, - "python.testing.unittestEnabled": true + "python.testing.unittestEnabled": true, + "githubPullRequests.ignoredPullRequestBranches": [ + "main" + ] } diff --git a/challenges/challenge1.py b/challenges/challenge1.py index 182c032..1b995b5 100644 --- a/challenges/challenge1.py +++ b/challenges/challenge1.py @@ -26,3 +26,14 @@ Interpret what the final expression means in the context of allowing or blocking a login attempt. """ +not(A and(B or not B)) +not (A and True) +not A + +The login credentials are not correct. The login attempt is blocked. + +#Oleksandr Maksymikhin +#Momtaz Yaqubi +#Rafaa Ali +#Derek Karungani +#Myint Myat diff --git a/challenges/challenge2.py b/challenges/challenge2.py index 504b52b..27282b5 100644 --- a/challenges/challenge2.py +++ b/challenges/challenge2.py @@ -29,3 +29,34 @@ # -*- coding: utf-8 -*- """ +at_least_one = finance_access.union(tech_access).union(all_access) +both_fincance_tech = finance_access.intersection(tech_access) +exclusive = (finance_access.intersection(tech_access)) + +#lack access +lack_access = [] +for i in All_employees: + has_access = False + for j in at_least_one: + if i == j : + has_access = True + if has_access == False: + lack_access.append(i) + +print (lack_access) + +overlap = both_fincance_tech + + """ + _Recommendation + We recommend do add one more group that include + employeeID who have access to both finance and tech + data to manage this group separately_ + """ + + +#Oleksandr Maksymikhin +#Momtaz Yaqubi +#Rafaa Ali +#Derek Karungani +#Myint Myat diff --git a/challenges/challenge3.py b/challenges/challenge3.py index d20302e..41c5f3d 100644 --- a/challenges/challenge3.py +++ b/challenges/challenge3.py @@ -20,3 +20,8 @@ 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. """ +from matplotlib_venn import venn2 +import matplotlib.pyplot as plt + +venn2([finance_access,tech_access], set_labels =('Finace','Tech')) +plt.show() diff --git a/challenges/challenge4.py b/challenges/challenge4.py index e3638b3..9b34033 100644 --- a/challenges/challenge4.py +++ b/challenges/challenge4.py @@ -32,3 +32,27 @@ Optionally convert the result back to binary with bin(), but focus on the XOR operation itself. """ +#Oleksandr Maksymikhin +#Myint Myat +#Rafaa Ali +#Derek Karungani + +data_for_transmission_string = '1010101' +data_for_transmission = int(data_for_transmission_string,2) +security_key = int("1100110",2) +checksum = data_for_transmission ^ security_key +checksum_for_transmission = bin(checksum) + + + +def receiver_verify_data(data_for_transmission_string,checksum_for_transmission): + data_after_transmission = int(data_for_transmission_string,2) + receiver_checksum = data_after_transmission ^ security_key + + if receiver_checksum == checksum_for_transmission: + return "Transmission is successful" + else: + return "Transmission failed" + +receiver_verify_data(data_for_transmission_string,checksum_for_transmission) + \ No newline at end of file