Designing a protocol to record attendance to lectures Scenario: a class that is not mandatory. The teacher wants a protocol that will satisfy the following requirements:


It must record each student's attendance.
A student X should not be able to say that another student Y went to the lecture.
The teacher should not be able to know who attended the lessons and who didn't until the end of the term.
It must provide integrity and non-repudiation.
It must be simple and fast.


This is what I thought:

Suppose that there are N students enroled.

Each class:


The teacher generates N random numbers, stores them somewhere safe, and writes them down on a separate piece of paper. 
He gives one of these to each of the students that attend a class. He asks them to sign the reverse of the paper.
The students sign, and give the piece of paper to the teacher.
The teacher can check whether a student invented a number.


At the end of the semester:


The teacher asks for ID of each of the enroled students (or any other document that contains the signature), so he can now know who attended each class and who didn't.


Are there any visible flaws?
Facing the same problem in an undergraduate class of about seventy students, I know of someone who came up with the following simple and effective solution because signing a paper had proven to be an undependable method for recording attendance:

In front of one of the four assistant instructors, he had the students present their IDs at the front desk as they came in, and an AI actually checked the photo of each student prior to scanning.  Students were not allowed to scan themselves in, and he used an OpenOffice Calc spreadsheet to record their data. This made things reliable--the bar code reader populated the spreadsheet in front of an AI.  It also made it easy to record lateness.  Names were not recorded, only ID numbers, which the AIs did not know. He did not know anyone's ID number off the top of his head, but he could find out all of them.  

For this to work in the way you wish, you would need to map each ID number to a new, class-specific number, and only let the certain people in the administration have access to a student's real ID number. 

Or you could make an attendance card for each student in your class with a photo and bar code/ QR code, and use a good pseudo-random number generator to create their temporary, class-specific ID number.

Your most difficult parameter looks to be #3:

The teacher should not be able to know who attended the lessons and who didn't until the end of the term.

This is not realistic, even in a large class.  You are asking a teacher not to remember faces and not notice empty seats.

At the end of the semester when grading, he sorted out the numbers and names and assigned attendance grades, etc.  It worked, and it was fast. Come to think of it, you could use public-key cryptography to have the instructor(s) sign the completed attendance document, thereby giving you non-repudiation for that too.