Public-key cryptography uses message authentication codes (MACs) and digital signatures to verify the authenticity and integrity of messages. MACs are calculated using a secret key shared between the sender and receiver. Digital signatures are generated using the sender's private key and can be verified by the receiver using the sender's public key. Common MAC algorithms include HMAC, which uses a cryptographic hash function combined with a secret key. Asymmetric encryption algorithms like RSA enable confidential communication by encrypting messages with the public key while only the holder of the private key can decrypt.
Related topics: