start of authentication code