How can a cryptographic key add uncertainty for someone trying to decode a message?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

A cryptographic key adds uncertainty to a message by serving as a secret variable within an algorithm that transforms plaintext into ciphertext. In the context of information theory, the amount of uncertainty introduced into the solution for a cryptanalyst cannot exceed the uncertainty of the key itself.12

To maximize security, random keys are selected to ensure that the encryption process remains robust against unauthorized decryption. Modern cryptography often relies on computational asymmetry, where systems are designed such that it is computationally infeasible for an attacker to recover a message or a secret key even when they possess the encryption algorithm and numerous matching plaintext-ciphertext pairs. By basing these systems on "hard" mathematical problems—such as the difficulty of factoring the product of two very large prime numbers—the uncertainty for an attacker is tied to the complexity of solving those underlying mathematical challenges.23