In Katz and Lindell's Introduction to Modern Cryptography, Exercise 2.19 asks to find an encryption scheme that is perfectly secret for two distinct messages*, with the following hint:
The encryption scheme you propose need not be efficient, although an efficient solution is possible.
The solution they offer is to use a key space which consists of all permutations of the message space, and to encrypt by simply applying the permutation to each message, with the following note:
An efficient scheme meeting this definition can be constructed using pairwise-independent permutations (a topic not covered in the book).
Please describe an efficient** scheme that is perfectly secret for two distinct messages. I could not find anything about pairwise-independent permutations through a quick Google search; if your solution uses them please briefly describe them as well.
* An encryption scheme for two distinct messages is characterized by needing to use the same key to encrypt both messages. It's considered perfectly secret if knowing the pair of ciphertexts does not leak any information about the corresponding plaintexts.
** What the authors mean by "efficient" is not clear. I am interested in anything better than a key space of size $|M|!$, but I assume they had a specific solution in mind.