Cryptographic key generation and authentication testing