“He Should Have Gone to Prison”: Grant, Stanton, and the Washington Cipher
ECW welcomes back guest author Cory M. Pfarr.
In the winter of 1863–1864, Maj. Gen. Ulysses S. Grant—then commanding the Division of the Mississippi—found himself at odds not with a Confederate army, but with a cipher book. The dispute drew the attention of Secretary of War Edwin M. Stanton, resulting in a sharp reprimand from Washington. It revealed how tightly the Union high command guarded its communications system.
In late 1863, Grant prepared to travel from his headquarters in Nashville to Knoxville to inspect military conditions in East Tennessee. There, Maj. Gen. Ambrose Burnside (eventually supported by troops under Maj. Gen. William Tecumseh Sherman) continued to hold the region against Lt. Gen. James Longstreet’s troubled Confederate campaign. For Grant, the journey required more than transportation and escort. It required secure communication with Washington.[1]

That responsibility fell to Samuel Beckwith, a cipher clerk with the U.S. Military Telegraph Corps (USMTC). Established in October 1861, the USMTC operated the War Department’s telegraphic network, linking field armies with Washington through commercial telegraph lines. Though it served the army, the corps operated independently of military command. Its operators (largely civilians) answered directly to the secretary of war.
Beckwith became so closely associated with Grant that fellow staff officers nicknamed him “Grant’s Shadow.” Stanton intended that he accompany Grant wherever he went, ensuring the general could send and receive confidential dispatches. By January 1864, those communications relied on what General-in-Chief Henry W. Halleck described as “a new and very complicated cipher.”[2]
The system was a form of route cipher. Messages were written in structured lines and then transposed according to a predetermined pattern, with substitute words used for key names and actions. Designed for trained telegraph operators and guarded carefully by the War Department, the cipher was not intended for general distribution. Its control rested firmly in Washington, leaving little room for discretion in the field.[3]
Grant’s difficulty was practical. The Knoxville trip required that a skilled operator remain in Nashville, the relay point for secret dispatches with Washington, while another accompanied him east. Beckwith could not be in two places at once. Grant therefore ordered his “shadow” to remain behind and provide a copy of the “Washington cipher” to Col. Cyrus B. Comstock, an engineer on his staff whom he believed capable of learning the system.

The instruction collided immediately with War Department policy.
Beckwith refused. According to Grant, the clerk informed him that “his orders from the War Department were not to give it to anyone—the commanding general or any one else.”
A tense exchange followed. Grant later recalled: “I told him I would see whether he would or not. He said that if he did he would be punished. I told him if he did not he most certainly would be punished.” Faced with a direct order from his commanding general, and no representative from Washington to reinforce his own instructions, Beckwith yielded.[4]
The matter did not end there.
Word quickly reached the War Department. Between January 20 and February 4, 1864, a series of dispatches passed between Grant and General-in-Chief Halleck, effectively between Grant and Secretary of War Edwin M. Stanton. Grant was asked to explain his actions. He assured Halleck that “I shall be as cautious as I possibly can, that improper persons do not get the key to official correspondence,” but also protested what he considered “interference” by Col. Anson Stager, superintendent of the USMTC and Stanton’s chief telegraphic administrator.

Stager had already acted. Learning that Beckwith intended to instruct Comstock, he ordered that “Beckwith must not instruct anyone in the cipher.” Writing to Halleck on January 21, Stager defended his position. Stanton, he emphasized, had directed that operators be held strictly responsible for maintaining the cipher’s privacy. The system, he argued, was designed for trained telegraph experts; staff officers lacked the experience necessary to use it accurately, and mistakes could compromise official correspondence. The Washington cipher assigned to Grant, Stager insisted, “should not be known to any other party.”
The dispute was no longer between a general and his clerk. It had become a contest over authority, between the field commander of the Union’s western armies and the War Department officials who controlled the telegraph network connecting him to Washington.
With Stager’s views before him, Halleck issued Grant’s reprimand on January 22. Beckwith, Grant was informed, had “disobeyed the Secretary and has been dismissed.” Halleck went further. The clerk, he wrote, “should have gone to prison.” Edwin M. Stanton personally supervised the military telegraphs, Halleck reminded Grant, and telegraphic operators “receive their instructions directly from the Secretary of War.” Those instructions, he emphasized, “should not be interfered with except under very extraordinary circumstances.”

The rebuke did not stop there. It was not Stager who had interfered, Halleck insisted, but Comstock—and, by implication, Ulysses S. Grant himself—who had “interfered with the orders of the War Department.” Stager, he emphasized, acted as the secretary’s “confidential agent” in all telegraphic matters. Because of the unauthorized disclosure, Stanton ordered an entirely new cipher prepared, one “to be communicated to no one, no matter what his rank, without his special authority.”
Grant responded on February 4 in measured terms. He did not deny what had occurred. Instead, he defended the man who had carried out his order. Beckwith, he wrote, was “one of the best of men… competent and industrious.” In the matter for which he had been dismissed, “he only obeyed my orders and could not have done otherwise.” Grant accepted responsibility himself and concluded simply: “I respectfully ask that Beckwith be restored.”[5]

Beckwith was reinstated on February 14 and continued as “Grant’s Shadow” for the remainder of the war.
The episode revealed something larger than a bureaucratic dispute. It underscored how tightly the Union war effort depended upon a centrally controlled communications system, one firmly in the hands of the War Department, even when it conflicted with the needs of field command. In that system, the telegraph, and the cipher that secured it, functioned as an instrument of national authority, one Stanton was determined to control. Yet the dispute also exposed the practical tension between that centralization and operational necessity. Grant’s decision was not ideological but functional: he required flexibility in the field that the system did not readily allow. His response proved equally revealing. Rather than deflect blame, he defended the subordinate who had obeyed his order, placing responsibility squarely on himself. The machinery of war continued, but not without revealing the tensions embedded within it.
————
Cory M. Pfarr works for the U.S. Government and is the author of Longstreet at Gettysburg: A Critical Reassessment (2019) and Righting the Longstreet Record at Gettysburg (2023), both published by McFarland. His essays have appeared in Gettysburg Magazine, North & South, Studies in Intelligence, and The Massachusetts Historical Review, and he has presented his research at the U.S. Army War College. His forthcoming book, The Federal Signal Service at Antietam, is scheduled for release in 2026.
Endnotes:
[1] Ulysses S. Grant, Personal Memoirs of U.S. Grant, 2 vols. (New York: Charles L. Webster, 1885–86), 2:100-103.
[2] The War of the Rebellion: A Compilation of the Official Records of the Union and Confederate Armies, 128 vols. (Washington DC: Government Printing Office, 1880-1901), ser. 1, vol. 32, pt. 2, 172; The Friedman Legacy: A Tribute to William and Elizebeth Friedman, 3rd Edition, (Fort George G. Meade, MD: Center for Cryptologic History, National Security Agency, 2006), 58-59.
[3] John Emmet O’Brien, M.D., Telegraphing in Battle: Reminiscences of the Civil War, (Scranton, PA, 1910), 87; The Friedman Legacy, 58-59.
[4] Grant, Personal Memoirs, 2:103-105.
[5] OR, ser. 1, vol. 32, pt. 2, 150, 161, 172-173, 323.
thanks Cory — great article that shines light on Civil War OPSEC, command and control, and civil military relations … Grant emerges as a practical commander who isn’t afraid break a few bureaucratic rules to support operations and then defend the rule breaker – he knows what he can get away with and how to smooth ruffled feathers … while Stanton plays the petty, small minded bureaucrat …. one small question: Was Halleck still General-in-Chief in 1864 … or had Lincoln relegated him to Army Chief of Staff? thanks again!