A cryptosystem is a pair of maps
where is the keyspace,
is the plaintext or message space, and
is the ciphertext space. In many instances
and the images will lie in
. An element of the image of
is called a cipher.
We may assume that and
are injective, hence
identify a key
in
with its image
in
.
The cryptosystem has the property that for every encryption key
there is a decryption key
such that
. A cryptosystem with the
property that
, is called a symmetric
cryptosystem. Otherwise, if the key
, nor is
easily derived from
, we call the
cryptosystem asymmetric of public key. In that case,
is called the public key and
is called the private
key.