A

**cryptosystem** is (formally) a 5-tuple {

**P**,

**C**,

**K**,

**E**,

**D**} such that:

**P** is the finite set of all possible plaintexts *x*.
**C** is the finite set of all possible ciphertexts *y*.
**K** is the keyspace (the finite set of all possible keys) *k*.
**E** and **D** are the finite sets of encryption and decryption functions, respectively:

For each key *k* in **K**, there exists an encryption rule *e*_{k} : **P** --> **C** and a decryption rule *d*_{k} : **C** --> **P** such that, for any plaintext *x* in **P**, *d*_{k}(*e*_{k}(*x*)) = *x*.

(Part of the Everything2 Crypto Project)