Encryption, PKI and Identity Authentication
Cryptography essentials
Symmetric algorithms (AES, SM4) are fast and used for bulk data; asymmetric algorithms (RSA, SM2) are slow and used for key exchange and signatures. Hashes (SHA-256, SM3) give integrity; HMAC adds a shared key. A digital signature is produced with the sender's private key and verified with the public key; it gives integrity, authentication and non-repudiation, not confidentiality. A digital envelope encrypts the symmetric key with the receiver's public key.
PKI
Components: CA, RA, end entity, repository. A certificate binds an identity to a public key and is signed by the CA. Lifecycle: request, enroll (SCEP), use, renew, revoke. Revocation is checked by CRL (periodic download) or OCSP (online query). Certificate chains must be trusted end to end.
Identity authentication
AAA means authentication, authorization and accounting. RADIUS (UDP 1812/1813) is common for network access; HWTACACS (TCP 49) gives separate authorization and command accounting for administrators; LDAP and AD serve directory users. USG supports local, RADIUS, HWTACACS, LDAP, Portal, 802.1X and MAC authentication.
Worked example
Remote users must authenticate before SSL VPN access using AD groups. Reasoning: configure the LDAP or AD server, import users and groups, bind the virtual gateway to the authentication policy, and map the group to a role. Test with a login and check the user log. Keep shared secrets out of plain-text tickets.
Traps that cost marks
- Saying a digital signature provides confidentiality.
- Confusing CRL (a list) with OCSP (an online query).
- Assuming a certificate is trusted because it exists; check the chain and validity dates.
- Using RADIUS for per-command administrator accounting when HWTACACS is the fit.