black hat
A villainous person, often such a character in a book or film. The term is a reference to the color of the cowboy hat stereotypically worn by the villain in Westerns (as opposed to the hero's white hat). I'm pretty sure those black hats masterminded the heist—they are known for their lying and cheating.
black hat (or white hat)
used in reference to the bad (or good) party in a situation. This idiom refers to the colour of the hats traditionally worn by the bad (or good) characters in cowboy films.