A cryptographic key is a piece of information that determines the functional output of a cryptographic algorithm. In practice a key is required to encrypt plaintext into ciphertext and to reverse that process. Keys may be fixed values, randomly generated sequences, or derived from passphrases; their secrecy and integrity are central to the security of any cryptographic system. For general background see cryptography.

Types and characteristics

Cryptographic systems are commonly divided by how keys are used. Two broad families of cryptographic algorithms are:

  • Symmetric (same key for encryption and decryption) — often used for bulk data encryption because of efficiency.
  • Asymmetric or public‑key (different keys for encryption and decryption) — used for key exchange, signatures, and scenarios where secure key distribution is difficult.

Key characteristics that affect security include length (measured in bits), randomness or entropy, storage method, and lifetime. Strong keys are unpredictable and kept confidential; weak keys, reuse, or poor generation methods undermine cryptographic strength.

History and development

Keys have been part of secrecy systems since ancient ciphers, where a key might be a substitution table or shift amount. Modern key concepts evolved with mechanical and electromechanical ciphers, and advanced significantly in the 20th century. The invention of public‑key ideas in the mid‑1970s introduced separate public and private keys, reshaping secure communications and authentication practices.

Today keys appear in many forms: short secret keys for message authentication, long keys for asymmetric schemes, and ephemeral session keys that exist only briefly. Common standards specify accepted key sizes and formats — for example, symmetric ciphers often support multiple key lengths to balance speed and security.

Key management encompasses generation, distribution, storage, rotation, and destruction. Best practices include hardware security modules, secure random number generators, key derivation functions, and minimizing exposure through ephemeral keys. Compromise of a key commonly compromises the protected data, so operational controls and audits are essential.

Notable distinctions include the difference between a key and a password (keys are treated as binary secrets; passwords are human‑memorable), and between key length and algorithm strength (both matter). Emerging concerns such as quantum computing may require migration to new key types and sizes, underscoring the need for adaptable key management strategies.