My computer security professor uses the following notation, where S denotes a server and A denoted Alice. Alice wants to authenticate herself to the server. The hash function is a hash chain where $h^n(x)$ denotes a hash function $h(h(h(..h_n(x)..)))$. $n$ is stored on the server.
Assignment:
The following authentication protocol makes use of the Lamport hash construction (sometimes simply called ‘hash chain’). The construction simply consists of repeat- edly applying a hash function to an input value. We write h n (x) to denote hashing x n times, e.g. h 3 (x) = h(h(h(x))). Each user chooses a password pw and hashes this n times. He/she then sends it to the server. Let us assume that initially, n = 10 000. The server then stores a tuple (user, n, Y = h n (pw)) for each user in a database. Users can now authenticate to the server using the following protocol: The server checks if h(X) = Y , then decrements n and sets Y := X. So, after a successful run of this protocol the server holds a new tuple (user, n − 1, Y = h n−1 (pw)).
$ A \longrightarrow S : \text{I want to authenticate} \\ S \longrightarrow A : n\\ A \longrightarrow S : X = h^{n-1}(\text{password}) $
So now the hash is calculated on the device Alice uses. I am a bit confused now, because I always would receive the user's plain-text password and then hash it and store it in a database instead of receiving the password from the user. Also, I don't think this is possible at all in a web application.
My question is whether or not this protocol is used, and if so how would it be implemented. Also, what is more secure, hashing on the user side or the server side?