The cryptographic solution to this problem is to publicize related codes derived in such a way that the possessor of the secret code can recognize the derivation, but bystanders can't use them to rederive the secret code.
It's probably a bit much to expect Harry to use that in its strong form -- most of the relevant math was known in 1991, but it only rose to prominence with the Internet, and it's quite laborious by hand -- but there's probably a similar ad-hoc scheme he can use that'd provide reasonably strong authentication against a bunch of cryptographically naive wizards.
The fact that he uses prime factorization as his test for "can use you time turner to solve computationally hard problems" is evidence that he did know about prime number based cryptography, not strong evidence, but evidence still, since the prime-based crypto is the most common reason people are interested in having fast ways to factor primes.
This is a new thread to discuss Eliezer Yudkowsky’s Harry Potter and the Methods of Rationality and anything related to it. This thread is intended for discussing chapter 116.
There is a site dedicated to the story at hpmor.com, which is now the place to go to find the authors notes and all sorts of other goodies. AdeleneDawner has kept an archive of Author’s Notes. (This goes up to the notes for chapter 76, and is now not updating. The authors notes from chapter 77 onwards are on hpmor.com.)