The stranger should declare himself first.This counsel seems obvious enough, but very few people seem to actually realize it's importance.
I cannot begin to fathom the number of times someone has shaken my hand and said, "It's nice to meet you," without ever telling me their name or asking mine (sometimes "Father" works, but knowing the proper form of address hardly suffices for "meeting" someone; if you meet someone, you should at least know his name).
Whenever I find myself in such a situation, it takes every ounce of restraint not to say, "But we haven't met at all. All you've done is shake my hand on your way out the door or on the way to the buffet line." Strangely, my saying something like this would be seen as rude, which is why I restrain myself, but a failure to introduce oneself and acknowledge another person is somehow not seen as rude.
My hunch is that people say, "It's nice to meet you," from a desire to be polite, or at least from a general understanding that they should pretend to be polite. It seems a similar situation to the odd question, "How are you," when the one who asks the question doesn't actually want a response. It is supposed to be polite to ask the question, but this is really only a false politeness, unless you actually want to know how someone is.
Please, the next time you say, "It's nice to meet you," or something very similar, please be sure to first introduce yourself and, at the very least, ask the other person's name. It's to way to live pono, to live righteously.