Second only to polygamy, Mormons in the second half of the nineteenth century were known for violence. Paramilitary groups of “Danites” or “Avenging Angels” allegedly surveilled, threatened, and/or killed as directed by Church leaders. In three instances that I know of, non-Mormons portrayed members of these groups as using robes, hoods, and masks like those of the Ku Klux Klan. The purpose of this post is to put all three instances on the same page at the same time.
Graphical images of Mormons preparing for or committing violent acts were relatively common, so the fact that only three show masked Mormons suggests, I think, that the hooded-vigilante image was not dominant, at least in the nineteenth century. On the other hand, multiple images of Mormon temple rites showed initiates and priests wearing robes and/or pointed head-gear, so the three instances below were not entirely alone. 
Before we move on to KKK-style robes, we should note that one of the earliest graphical depictions of Mormon violence includes specialized robes. In The History of the Saints (1842), John C Bennett described a group whose members pledged, “to destroy by fire and sword all the enemies of Mormonism.” When so engaged, the participants were “clothed in female apparel, wearing a snow-white robe and a scarlet girdle” (see image below). 
In 1882 the cover of Sweet William, The Trapper Detective; or, The Chief of the Crimson Clan, showed a robed, masked, and hooded (presumed) Mormon next to a murder victim (see image below). I have not read the story and can deduce very little from the image, but it seems that the hooded figure is acting as a law-enforcement officer.  (Of course, the first KKK also imagined itself as “enforcing law.”)
Twenty years later, detectives again encountered hooded Mormons in The Bradys Among the Mormons; or, Secret Work in Salt Lake City (1903) from the series, Secret Service: Old and Young King Brady, Detectives (see image below). 
The figure on the front of the robes appears to be a heraldic lion salient. As above, I have not read the story, so I don’t know how the masked characters figure in the plot, but it seems that they were, again, enforcing laws. Terryl Givens wrote that “such devices” as the masks “sensationaliz[ed] Mormon secretiveness and mysteriousness” and “preserved the illusion of a Mormon identity that was radically alien.”  The title (and presumably cover) were repeated; I find suggestions of re-issues in 1907, 1917, and 1920. 
The last, and probably best known, example of violent, masked Mormons comes from the 1917 film, A Mormon Maid. 
The actions of various “Avenging Angels,” in robes and masks, drive a significant part of the plot. Richard Alan Nelson reported (1987) that one of the movie intertitles claimed that “this costume, but with the cross substituted for the eye, was later adopted by the Ku Klux Klan.”  I know of no historical basis for the claim that Mormon paramilitary groups used such robes, much less that the KKK borrowed the idea. On the other hand, the “all-seeing eye,” though not exclusively Mormon, was used by Mormons (for example: on the wall of the St George Tabernacle).
The Avenging Angels in A Mormon Maid were emphatically the bad guys—intimidating, spying, kidnapping, murdering, and so on. Whereas in (my irresponsible extrapolations from the covers of) the two stories above the masked figures seem to be representing the community and carrying out its wishes, the Danites in A Mormon Maid represent the leadership and control the community. Of course, I’m making huge assumptions about the content of the first two stories and the question of representation largely depends on perspective: some non-Klan southerners also felt represented and protected by the first Klan (1860s-1870s).
The most important context for A Mormon Maid is the 1915 film The Birth of a Nation, which featured nearly identical costumes and similar styles of action, though with the Klansmen as the “good guys” (see image below of a still from Birth of a Nation).  On the one hand, Mormon Maid portrayed Mormons quite negatively; on the other, putting the Avenging Angels in KKK robes might have partially undercut the negative impact since the Klan was enjoying a resurgence (ie, the “second Klan” was started in 1915 and used Birth of a Nation as a recruiting tool). 
I don’t have any direct evidence, but I imagine that in 1917 the pickelhaube—the spiked helmet used by, among others, German soldiers in World War I—negatively influenced audience perceptions of spiked helmets.
 For examples of portrayals of Mormon violence and temple rituals, see Jared Farmer’s The Image of Mormons: A Sourcebook for Teachers and Students (self-published e-book, 2013), 230-253.
 John C Bennett, The History of the Saints; or, An Exposé of Joe Smith and Mormonism (Boston: Leland & Whiting, 1842), 270-273. The quoted text is from p 271; the illustration, by FE Worcester, is on p 273. Bennett gives three names for the group: the “Destructives,” “Destructionists,” or, later, “Destroying Angel.”
The text accompanying the image says: “Destroying Angel. ‘Do as he hath said, and fall upon him, and bury him.’— 1 Kings, ii. 31.” The image shows fourteen male adults: twelve in white robes (the Destroying Angel) attack one in nineteenth-century business clothes while one in dark robes (Joseph Smith) supervises. Four of the figures are identified by name in the caption, with correlating numbers near their feet in the image. The scene is set in a room with little or no furniture (there are two candle-stands and possible a book stand or altar in the background). Joseph Smith (#1) stands at far right wearing a dark-colored robe and a hat something like a three-pointed mitre. He appears to be directing the proceedings. Twelve of the figures are wearing white robes held at the waist by a sash/girdle. Their headgear appears to be a combination between a turban and a top-hat. Each bears the same type of battle-axe, possibly intended as a horse-man’s axe from the 1400-1500s, approximately a meter long, with blade, hook, and spike. I do not notice anything distinctive about their shoes (other than that they are wearing shoes/boots). Two of the Angels restrain the (struggling) victim as DB Huntington (#2) raises his axe to strike a presumably lethal blow. Four of the Angels, at far left, merely observe, not holding their axes in readiness; another four, including RD Foster (#3), have postures suggesting they will join the action if necessary. The final Angel, Willard Richards (#4) stands in readiness but next to Smith, presumably as a bodyguard.
 Joseph E Badger, Jr, Sweet William, The Trapper Detective; or, The Chief of the Crimson Clan, in series, Beadle’s Dime Library 14.170 (New York, 1882 Jan 25). I have not read the story and perceive nothing in the image to indicate Mormon-ness, but Gary L Bunker and Davis Bitton (The Mormon Graphic Image, 1834-1914: Cartoons, Caricatures, and Illustrations (Salt Lake: University of Utah Press, 1983), 53) identify it as Mormon: “If the Mormons’ image in periodicals was bad in 1882, the graphic impression in books was worse. Sweet William, The Trapper Detective, one of Erasmus Beadle’s dime novels, featured a hooded Mormon vigilante committee on its cover.” The caption on the cover, presumably quoting the robed-figure, says: “Murder has been done, and vengeance called for in the name of the vigilance committee. We are bound by solemn oath to listen to and investigate every appeal to our authority.” If this quote is, in fact, from the robed figure, it would suggest a law-keeping rather than law-breaking function.
 Frank Tousey (publisher), The Bradys Among the Mormons; or, Secret Work in Salt Lake City, no 239 in weekly series, Secret Service: Old and Young King Brady, Detectives (New York, 1903 Aug 21), cover. Image courtesy of Burns Library, Boston College. The caption reads: “‘Run for your life!’ gasped the Mormon, dropping a bundle of bank notes. Harry saw three masked figures come from behind the rocks with Old King Brady himself. ‘Halt there, Simon Sellers, traitor and thief!’ shouted one of the men.” Without reading the story, I predict that: The woman at the left is Alice Montgomery, part of the Brady Detective Bureau; the kneeling man in the blue suit is Harry Brady (aka Young King Brady); the kneeling man in the green suit is Simon Sellers, a Mormon; Old King Brady is in the background in the blue double-breasted suit.
 Terryl L Givens, The Viper on the Hearth: Mormons, Myths, and the Construction of Heresy, 1st edition (New York: Oxford, 1997), 120. “[Accompanying a small reproduction of the New York Detective cover:] Masks and cloaks appear in this ‘New York Detective’ adventure, in the Frank Merriwell story, in Bessie Baine, and many others. In addition to the obvious virtue of sensationalizing Mormon secretiveness and mysteriousness, such devices preserved the illusion of a Mormon identity that was radically alien.”
 Issue number 444 (1907 Jul 26) lists an issue 410, The Bradys and “Mr. Mormon”; or, Secret Work in Salt Lake City on its back cover. In Viper on the Hearth, the image Givens uses reads, “The Bradys Among the Mormons; or, Secret Work in Salt Lake City,” no 964 (1917 Jul 13). Google Books gives no preview, but cites issue 1135 from 1920 with the “Mr. Mormon” title. gBooks also gives the author as Francis Worcester Doughty.
Brady appeared in Social Service in 1904 in a semi-humorous anecdote. An office boy at the magazine’s headquarters was discovered shirking his duties to read “a 26-paged compilation, with enormous headlines, beginning ‘Secret Service. Old and Young King Brady Detectives, The Bradys Among the Mormons; or, Secret Work in Salt Lake City’! [¶] Poor boy and poor book! Some social service was certainly necessary.” The article reports that “fortunately” the SS had recently prepared “a list of books suitable for the reading of office boys.” No author listed, “Book Lists for Office Boys,” Social Service 9.1 (New York, 1904 Jan): 6.
 A Mormon Maid, silent film, 68 minutes, directed by Robert Z Leonard, from screenplay by Charles Sarver and Paul West (Famous Players-Lasky, 1917 Feb 14). The full film can now be viewed at archive.org. For plot summary, see Keepapitchinin.
 I have been unable to verify the quote; I skimmed through the version at archive.org and did not see it, but I could have missed it. Richard Alan Nelson, “Commercial Propaganda in the Silent Film: A Case Study of ‘A Mormon Maid’ (1917),” Film History 1.2 (1987): 152 (149-162).
 The image is a scene from The Birth of a Nation used as a frontispiece for a 1915 or 1916 edition of The Clansman: An Historical Romance of the Ku Klux Klan (Thomas Dixon Jr, New York: Grosset & Dunlap), the novel upon which The Birth of a Nation was based.
 A Mormon Maid (and usually Birth of a Nation) is discussed in Randy Astle and Gideon O Burton, “A History of Mormon Cinema,” BYU Studies 46.2 (2007): 32-35 (12-163); Richard Alan Nelson, “From Antagonism to Acceptance: Mormons and the Silver Screen,” Dialogue: A Journal of Mormon Thought 10.3 (1977 Spring): 59-69; and Sutton, Travis. “According to Their Wills and Pleasures”: The Sexual Stereotyping of Mormon Men in American Film and Television, master’s thesis, University of North Texas, 2009 May, p 100-106, courtesy of UNT Digital Library.