We now consider some other additional cryptographic protocols that are based on having separate keys for encryption and for decryption. In the Diffie–Hellman protocol, each actor had just one private key, whereas we will now consider protocols in which the private keys are split into two: an encryption key and a decryption key. The relationship between encryption and decryption keys will then be governed by Fermat’s little theorem.
We are going to use modular exponentiation to model encryption and decryption. In particular, we will be considering pairs of integers {\mathopen {}\left (e,d\right )\mathclose {}} such that k^{e\cdot d} \equiv k \mod p; such a pair is an encryption-decryption pair modulo p. To find a good source of such encryption-decryption pairs, we must return to Fermat’s Little Theorem and develop some of its consequences.
For simplicity, we had previously established Fermat’s Little Theorem only for naturals. But it holds, in fact, for all integers, which we shall need: