Aja and Emily have decided to quit their jobs as TAs and become l33t h4x0rz. But it…
- User
Aja and Emily have decided to quit their jobs as TAs and become l33t h4x0rz. But it turns out, hacking is mostly just brute force trial and error. They have guesses at what the password hashing function is, but need to confirm it. Here’s where you come in. They need you to verify if their password cracker is working. Don’t worry, you won’t need to know anything about cryptography. In fact, the final password cracking algorithm will be hidden from you. You will be given a function that can compare two hashed passwords and returns true if they are the same unhashed password, and false if they are not. Using this function, we want to determine if there are popular passwords in a list because those accounts likely share overused, simple credentials and are easily exploited. Your job is to take a list of unsorted passwords, and determine if more than half are the same password. For example, let A, B, and C be unhashed passwords. • [A,A,A,A]wouldresultin[1,2,3,4] • [A, A, B, A] would result in [1, 2, 4] • [A, B, C, A] would result in [] • [A,A,A,B,B,B,C,C]wouldresultin[] You cannot compare passwords directly to each other because they are (naively) salted. Good luck! Make Aja and Emily proud. Develop an efficient divide & conquer algorithm to determine if more than half are the same password and if so, retrieve the indices the popular password is stored in. Notes: • You must use the provided function to compare two passwords. • Your output must be in ascending order.
- Assistant