A simple program implementing authentication from scratch