The tradition of the handshake is centuries old and began as a way to show you were friendly and literally did not have any weapons hiding up your sleeve. What they didn't know then, and what we know now, is that two people shaking hands are basically doing the same thing as two dogs sniffing each other in greeting: We're assessing the other person and in turn giving them the opportunity to do the same. And there's a correct way to do it.
Introducing yourself to another person begins with a handshake. Extend your hand — your whole hand, not just your fingers — as you say hello. Shake from the elbow, not the wrist or shoulder, and shake only for three to four seconds (that's two to three pumps, if you pump), which should be about as long as your greeting.
The best introductions are conversational yet brief, and they use simple public speaking tricks. For instance, using your name more than once as you introduce yourself will help the other person remember you (though it may feel conversationally clunky). Similarly, saying a new acquaintance's name (twice, if possible) in the first 12 words of conversation will increase your odds of remembering that name, and it also makes you appear interested (perhaps more than you really are). And don't forget to make eye contact and smile. You'll put everyone more at ease.