Password authentication is not too complicated to make from scratch, it will also help to get a better understanding of how it works.

Read more at the source