There was a Stargate SG-1 episode like this exercise once. It was very well done too.

So I assume we're left at the coming up with the algorithm part? How about just starting with the implest...