In the movie "Babe", the pig protagonist learns a secret "password" ("Baa Ram Ewe... Baa Ram Ewe...") that enables him to gain the trust of some sheep in a sheep-dog competition. Ignoring for a moment the cryptographic problems of establishing this password amongst all sheep, I find myself wondering: Why do the sheep even have a password in the first place? What purpose could this password possibly serve? Surely this isn't so sheep can establish a chain of trust with respect to a trusted "wolf" (sheep-dog) like a certificate authority -- the sheep-dogs in the "babe" world are universally distrusted, and even if one were trusted, a sheep-dog doesn't routinely service far-flung flocks. Why is there a password?
After a re-read of the source novel, I've come to the conclusion that the goal of the password was to allow sheep from different farms to recognise each other, specifically with the goal of preventing a wolf (e.g. a real wolf) from infiltrating the flock, the metaphorical "wolf in sheep's clothing".
Note that they refer to the password as a countersign
“ ’Tis a saying, see,” said another, “as lambs do larn at their mothers’ hocks.” “And then wherever we do go…”
“…or to another fa-a-a-a-arm…”
“…we won’t never come to no ha-a-a-a-arm…”
“…so long as we do say the pa-a-a-assword!”
For a long moment the flock stood silent, the only movement a turning of heads as they looked at one another. Fly could sense that they were braving themselves to tell this age-old secret, to give away—to a wolf, of all things—this treasured countersign. - The Sheep-Pig