In some cultures, but by no means all, white has long been associated with purity and goodness and black with evil. The term white hatoriginated from the Western genre of movies and television in which this white/black dichotomy is sometimes played out in the costuming. In movies and shows of this type, for example The Lone Ranger, the hero would wear a white hat, while the villain would be seen with a black hat. This cultural emblem has given rise to several different expressions and meanings for “white hat.”
First, the phrase “guys in [the] white hats” or “good guys in [the] white hats” is often used to mean that the people referred to are each like a “white knight” or a “knight in shining armor,” that is, a good person, a rescuer, a savior, or simply someone who upholds the law and does the right thing. The image was popularized outside of Westerns in advertisements for Dodge automobiles in the 1960s. In these ads, the Dodge sales people, “the Dodge Boys,” were referred to as “good guys in white hats” and portrayed as friendly, helpful, and customer-oriented, as well as able to “beat the competition to the draw.”
More recently, white hat has developed two meanings in the realm of computer security and search engine optimization (SEO) practices, respectively. White hat SEO follows guidelines proposed by search engines and doesn’t try to beat the system to improve listings and/or make money. White hat hackers, also referred to as “ethical hackers," perform many of the same hacking techniques as other hackers or crackers: they identify security weaknesses in computer systems and networks. Instead of taking advantage of the weakness in a malicious way, however, white hat hackers expose the weakness in order to help the system’s owners repair it before there is a destructive security breach.
Different means are taken to report the weakness. In some cases a phone call or email may convey the finding, while in others, the cracker may leave an “electronic calling card” that signals to the webmaster that security has been breached. This partly depends on whether the white hat hacker is hacking for a hobby or as a paid service, whether as a company employee or as a security consultant. Many former black hat hackers who hacked out of malice or for gain have turned “white hat” and become computer security experts who specialize in testing system security. Some even hold a National Security Agency certification.