The same method can be used to display any kind of indexed data where the viewer has to know the index to get the matching data, but the whole dataset without the matching indices need not be kept secret from the viewer. One important thing to keep in mind is that the list of marks is accessible on the client. I usually order the data in ascending order of marks so that the order doesn't reveal any data about the IDs.
The following instructions are for a minimal setup that puts in a webpage a single input box where the student can enter an ID number (or any string) and a button to submit a query that replaces the screen by a very simple screen that shows the ID and the mark (or "mark not found").
tz = [
tzenc = [
marks = [