I remember the movies of old where spies would greet each other with innocuous phrases and expect a particular response which would indicate that the respondent was the person being sought. And then of course there are the secret handshakes which served the same purpose.
I think all cultures have these codes for greeting others and the person being greeted can be easily thrown off balance if the response isn't what is expected. The Japanese bow and the greeted person must bow at the same depth as the other person. The Thais do not shake hands but wai (A bow accompanied by a Catholic-type amen gesture of the hands). Traditional Filipinos greeted their elders with a mano. Some cultures even expect males to kiss each other like females do (the Russians and the Arabs, I think).
There are some rules regarding greetings that are familiar to people within cultures. Ang hindi pagmano or not kissing an adult relative is considered an insult in the Philippines. Shaking the hand of an adult relative is relatively strange. (I don't remember ever shaking my brothers' hands to greet them Merry Christmas for example. Usually we give each other a hug or a pat on the back).
I remember one famous incident where an American President and a Russian President kissed each other and the American President did the unthinkable by wiping his mouth with a hankie after the kiss.
The only difference between spies and all these cultural form of greetings is that spies keep their codes secret while cultures do not. The greeting forms of all cultures, however, are codes no less which are as loaded with meaning.