A Security Device


Think of simulating a security installation very similar to those installed in many offices and homes. The installation has a keypad and an engine (a controller) used to decide whether the user has entered the correct access key or not. The keypad has ten keys, labeled from '0' to '9'. The security engine will unlock the lock when it finds the correct access code in the input string. For example, let's assume that the access code is 33441. If the user enters the string 91352033441245, then the lock will be unlocked as soon as the engine finds the last correct letter of the access code in the input string. The engine will lock the lock again when the user enters the locking code. Assuming that the lock code is 33444 then the lock will be locked and unlocked as described below.

913520334412451033444123970001112334451334410101
  unlock--^         ^--lock        unlock--^

Your program will read from standard input without echoing the input characters. Characters other than digits 0 throuh 9 will be quietly discarded. Your engine will recognize a fixed access code. The access code will be first four digits of your Social Security Number, followed by a 1 for the unlock code and by a 4 for the locking code.

DDDD1 is the unlocking code
DDDD4 is the locking code, where DDDD are the first four digits of your SSN

As soon as the last didgit of the access code is entered, your program will signal the action taken (lock or unlock).

Let's now assume that a possible intruder does not have any idea about how long the access string is. You decide to test how long it takes for one to unlock the lock. One possible way to try to break the lock is to generate a random sequence of numerical digits as the input string to the device. Of course, after each digit input from the keypad the intruder should check to see whether the lock has been unlocked or not. This would naturally increase the time it takes an intruder to break your security mechanism.


What you'll turn in

  1. A well commented listing of your program (C or C++ is recommended but not required). Note that grading, as described below, considers both the functionality and the readability of your code. You may also want to have a look at a grading sheet used in the past for a similar assignment. If you are unsure about what the documentation of a program means, then you may want to read this document.
  2. A floppy disk (3.5") which contains the source file(s) and a README file. In the README file indicate what the program does, how to build the executable, the platform (software and hardware) it's been tested on, and how to run it, plus any other information you consider useful - like the name of the author, disclaimers, etc.
  3. A memo describing what you have done, how and your findings. In the memo clearly state what is the language of the FA you have implemented. Also indicate what is the regular expression corresponding to that language. There will be two attachments to the memo:
    1. a context free grammar that generates the same language
    2. the state transition diagram for the FA.

    Direct the memo to your class instructor.

Grading

  1. A mark between 0 and 10 for functionality. This mark basically indicates in what measure your program works properly.
  2. A mark between 0 and 10 for readability. This mark indicates how well documented your program is, and how good is the report you turn in (the memo).
  3. Multiply the above two marks to get the mark for this programming assignment.

Varia

You don't need to be concerned about optimization(s). In particular you are not required to minimize the number of states in your FAs. You can do so if you want but this is not a must.


(c) 1996, Virgil Bistriceanu - virgil@csam.iit.edu
Posted: November 17, 1996
Last update: November 17, 1996