 The history of cryptography provides evidence that it can be difficult to keep the details of a widely used algorithm secret (see security through obscurity).A key is often easier to protect (it's typically a small piece of information) than an encryption algorithm, and easier to change if compromised.Thus, the security of an encryption system in most cases relies on some key being kept secret.