What is the keyspace of ROT-13? Today I was having a discussion with my cryptography lecturer about the keyspace of a ROT-13 cipher. He argues that the keyspace is 0 because it doesn't have a key.

Could anyone explain to me why the keyspace is 0 and not 1? I could understand if he said that it doesn't have a keyspace but I don't understand why it could have a keyspace of 0.

I was further confused when he said that it was possible for a cryptographic function to have a keyspace of 1. Could someone give me an example of a cryptographic function with a keyspace of 1 and explain how it is different to one with a keyspace of 0?

I feel fairly confused about something that seems like a pretty basic concept.

Thanks for any help.
I think it's better to define the  keyspace of an unkeyed function as having one element.

Some advantages:


Computing the key size as $log_2 1$ correctly tells you it's a 0 bit key
For encryption you pick one key from the set. You can pick an element of a single element set, but can't pick from an empty set
Functions with multiple inputs are often defined to take the Cartesian product of their inputs. For example for encryption this could be $M \times K \to C$ where $M$ is the space of messages, $K$ the key space, and $C$ the ciphertext space. One again, this only works correctly if you use a single element set as key space.