1 Introduction

"Cyber Police; proud to be a part of it!"

The proud motto flies over headquarters office where you are now
in your first week of real work after graduating from Polytechnics.
You couldnt believe it when the gentleman with the dark sunglasses
asked you to be a part of it. And now you are a real Cybercop. Mom 
is so proud.

"Rookie, listen up!", the bulky sergeant rudely awakenes your 
daydream, "we have a MFU in some companies making paying taxes for
our lazy asses. ARE YOU READY TO SERVE YOUR COUNTRY!!!".
"Sir, yes, sir!", you shout, knowing full well that the question 
was not really a question.
"Good. Dim the lights..."

2 Assignment

You are requested to stakeout companies being plagued by criminal 
behaviour. File are changed without explicit permission from the
powers that be. And not just any file, no salaries, bonuses,
strategy files, anything goes. Cyber Police has been called in
to stop the criminals. To accomplish this, Cyber Police has 
changed systems internally and set up some facilities to perform 
audit trails.

You will have to implement a CyberPoliceAgent. The agent is
capable of checking events to see if criminal activity takes
place (the stakeout operation) and the agent must also supply the
algorithm for checking whether a file is legitimate.

The stakeout is always done at a COMPANY and this company will
give you the legitimate BYTESTREAMS. EMPLOYEES will then start
CHECKING IN bytestreams. You will have determine a way to
compare these bytestreams to the ones you know are legal and 
you will have to return a list of perpetrating employees --
ie, employees who have checked in bytestreams not known or
bytestreams not equal to legal streams.

Yes, these are rigid guidelines. Control is good.

3 Example

Mick tries to check in a changed version of HelloWorld.class.

* Legal byte stream:

  HelloWorld.class
  -> 4341464542414245303030303030313132323333

* Checkin event:

  Mick Mikzotznky checks in HelloWorld.class
  -> 4341464542414245343434343434333332323131

* Criminal:

  Mick Mikzotznky

4 Hints

- dont compare the bytestreams, compare the hash
- MD1, MD2, MD3, MD4, MD...
- java.security is your friend
- in your new job look for a clever way to digest messages
- now go right to CyberPoliceAgentImpl and check the other
  classes later if you want to see the forest for the trees
