Key-based authentication framework with PHP and OpenSSL