# Just a super basic question - Does the key create the algorithm?

I don't understand how the key gives you the algorithm, in other words I am having trouble understanding how the key works in symmetric encryption. My book says:

"Symmetric encryption transforms plaintext into ciphertext using a secret key and an encryption algorithm"

So what does the secret key do, is it like a password to give you access to the actual encryption? Also my book says:

"Plaintext message chosen by cryptanalyst, together with its corresponding ciphertext generated with the secret key"

It says "generated with the secret key", so the key creates the algorithm?

• No, the key is one of the inputs to the algorithm. When encrypting you input both the key and the plaintext to produce the ciphertext. You must know the algorithm in addition to knowing the key. Feb 20, 2018 at 21:10
• The analogy "key = password" works, at least functionally. In actual practice, the password is processed to become the key, but the function remains.
– fgrieu
Feb 20, 2018 at 21:14

The key does not create the algorithm.

The algorithm is a fixed, publicly known set of steps. Clearly, a fixed, publicly known set of steps is not capable of encrypting anything.

So we include some secret information into the steps in the form of a key. A key for a symmetric encryption algorithm is a random sequence of bits that is kept secret. The knowledge of this secret random sequence of bits is what enables one to perform the encryption/decryption steps - and what prevents anyone else from doing the same.

For example, the AES algorithm uses the following steps:

• Mix Columns
• Substitute bytes

The Add key step is the same instruction for everyone who uses the algorithm, but the data that the instruction operates on is different for everyone because of the key.

This may be the source of the confusion. There are two things going on in an encryption algorithm:

• The instructions, or steps that are applied
• The data, which are the bits of information that the instructions operate upon

The instructions (the algorithm) are fixed and publicly known. The key is data, and it provides the source of secrecy that enables one to compute the encryption/decryption operation. The plaintext and ciphertext are also data, which are operated upon by the instructions in conjunction with the key.

• Is the AddRoundKey() the same as Add Constant or Add Key bullet? Feb 21, 2018 at 2:07
• @Q-Club Yes, Add Key should say AddRoundKey to be more precise. However I don't want to convolute the simple question/answer by introducing the idea of round keys as opposed to the key that parameterizes the algorithm. It's not technically correct, but I think the extra detail would detract towards the enlightenment of the asker. Feb 21, 2018 at 2:11