- Terminology and Concepts
- Security Encryption Scheme
An encryption scheme consists of a set and a corresponding set of encrypting and decrypting functions, respectively.
For each , there is a unique key where .
An encryption scheme is also called a cipher.
It should be clear that every is actually a representative of some bijection from to . In this task, you have to count the number of such bijections and, hence, the number of keys that produce different encryption functions.
Assume that which is given as the input.
The input consists of a single positive integer .
Output a single positive integer, the number of bijections.
Let us assume that and .
We can have encryption schemes where can be mapped to or or , can be mapped to the remaining two, and can be mapped to the unmapped one.
This accounts for such encryption functions.