improved openssl check in encrypt