What exactly does a key do? I am getting to grips with cryptography as a total newbie, and am struggling with encryption &quot;keys&quot; and how to visualize them.  From http://computer.howstuffworks.com/encryption.htm/printable:

Symmetric-key encryption is essentially the same as a secret code that each of the two computers must know in order to decode the information. The code provides the key to decoding the message.
Think of it like this: You create a coded message to send to a friend in which each letter is substituted with the letter that is two down from it in the alphabet. So &quot;A&quot; becomes &quot;C,&quot; and &quot;B&quot; becomes &quot;D&quot;. You have already told a trusted friend that the code is &quot;Shift by 2&quot;. Your friend gets the message and decodes it. Anyone else who sees the message will see only nonsense.
The same goes for computers, but, of course, the keys are usually much longer. [...] The DES uses a 56-bit key.

This doesn't make sense to me because the process of &quot;shifting by 2&quot; sounds like the algorithm that is being used, yet it is referred to as a &quot;key&quot;?  If this is the key, then what is the algorithm?
I also don't completely understand what it means the key is &quot;56 bit&quot; in length.  The linked article mentions

56-bit key offers more than 70 quadrillion possible combinations

Now, this huge number is just under $2^{56}$, so each of those $56$ bits can be either a $1$ or a $0$, but I don't see how this fits into it all.
Can someone please clarify this for me?
Picking up what has been said in the comments:

to simplify: symmetric ciphers are like mathematical operations with 2 operands and 1 result. There is The plaintext message $m$ and $k$ as the key and they result in the ciphertext $c$. In your example, the algorithm can be cut down to a addition and modulo:

$c = (m + k) \mod k_{max}$

And of course there is a reverse algorithm (or more simply operation) that will turn $c$ into $m$ again:

$m = \begin{cases} c - k,&amp; \text{if } c\geq k\\ c + k_{max} - k,&amp; \text{otherwise} \end{cases}$

To sum it up: The way of calculation (the algorithm) never changes. Instead, the parameter(s) to it, the key, are different.



In the computer world these operations are much more complex and involve operations that are easy to compute in the binary system (e.g. XOR or bit-shiftig) that are rather complex to express mathematically.