Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Sam wants to leave a secret message for Kim. They share an office on different s

ID: 3661816 • Letter: S

Question

Sam wants to leave a secret message for Kim. They share an office on different shifts in the data backup and recovery division of the Umbrella Corporation. They will leave a post-it note in the top drawer of a filing cabinet they share if they want to give each other a secret message. Each can check when they arrive on their shift, however Malfoy can snoop on them and read the message that is left for each because the top drawer of the filling cabinet is unlocked. They decide to use a locking solution on the filing cabinet drawer. However, they only want one key each, and NOT the shared keys for the lock. Kim says why don’t they use two locks, but she cannot figure out how to lock the drawer without a hidden key to her lock and Sam’s lock put somewhere that Malfoy cannot find. If they drawer on the filing cabinet can accommodate two locks, how can this be solved? Write an algorithm that solves the problem with Kim and Sam only having one key to their respective lock, and there are no keys to the locks hidden from Malfoy. The algorithm should also solve the problem of communicating between Kim and Sam that one of them left a message for the other by virtue of using the locks and the single filing cabinet drawer.

Explanation / Answer

Algorithm:
Start
Sam has a lock and key - let us call it as Sam's lock
Kim has a lock and key - call it as Kim's lock
The locks are press type - you do not need a key to lock but you do need a key to open
Kim has Sam's lock and Sam has Kim's lock
Whenever they are leaving a message, they will leave the message first and then lock the cabinet drawer using the
other person's lock
Sam enters the Shift
Sam writes and leaves a message for Kim
Sam encrypts a shared message authenticator
Sam locks the drawer using Kim's lock
Sam leaves the shift
Kim enters her shift
Kim obsereves that the cabinet drawer is locked
- that means there is a secret message awaits her
Kim opens the drawer using her key
Decrypts the shared message authenticator and
reads the message
When there are no messages to be left, they can keep the lock in a common place
Stop Algorithm

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote