In cryptography, both public and private keys are used for encryption and decryption. Public key encryption uses a key pair - one public (shared) for encryption and one private (secret) for decryption, or vice versa for digital signatures. Symmetric encryption uses a single shared key, while asymmetric uses the public/private pair.