In "From Witchcraft to Card Tricks" (page 7) Stephen Minch says there is "evidence to show that book tests were being done as early as the fourth century C.E.". He mentions reports by St. Augustine and also earlier exposs by Lucian and Saint Hippolytus of methods for reading sealed messages and fraudulent mind reading. Through the wonders of Google I managed to find some of the passages he must have been referring to:
Against the Academics
(page 55 ff.)
"And I cannot recall without stupefaction the fact that to a friend of ours, and a disciple of yours who wished to make fun of him in demanding insolently of him that he should tell him of what he was thinking in his mind, Albicerius replied that he was thinking of a line of Virgil. Amazed, the other could not deny it, but went on to ask what line it was. Albicerius, who scarcely ever had noticed even in passing the school of a grammarian, gave out the lines glibly without difficulty or hesitation."
Alexander the Oracle-Monger
"He contrived various methods of undoing the seals, read the questions, answered them as seemed good, and then folded, sealed, and returned them, to the great astonishment of the recipients."
Refutation of All Heresies
Rather a lot to copy and paste, but see in particular Chapters XXVIII and XXXIV.
This takes us back to the second century AD (CE), and the kinds of methods described probably go back quite a bit further.