Ernst, who lives near Madison, Wis., and works for Wisconsin Public Television, first found out about the two when she was doing research for her master's degree on the effect of the 1862 campaign on Maryland civilians.
Kretzer, known as a "fiery and impulsive" unionist, made a huge American flag and hung it on Main Street outside her house. When the Confederate soldiers came through town, she hid the flag in the ashes in her yard on the urging of neighbors.
Miller, a secessionist, gave Confederate soldiers water during the battle, even as Union shells were raining down around her. Told to hide in a cellar, she refused.
"I will remain here as long as my army is between me and the Yankees," she said.
Ernst said the two must have known each other and she decided to write a fictionalized account of how the war affected their fictionalized friendship. Ernst said a lot has been written about the soldiers, so she wanted to show how the war affected the women on the periphery of the battle.
At the beginning, both of them think of the war in philosophical terms, but that changes once the killing starts, she said.
The book also describes how many men left town with valuables before the battle, leaving their wives and children to fend for themselves as the two armies fought.
"That must have been absolutely terrifying," Ernst said.
Ernst said the book is aimed at middle school-aged students and up.
Ernst said she first fell in love with the area when she was a camp counselor near Sandy Hook. She said she used to take people frequently to the battlefield and to Harpers Ferry, W.Va.
"This is really where my heart is," she said.
Ernst, 38, said she would like to continue writing for young people and eventual turn to writing full time, and would love to see her book used in schools as a way to get kids interested in history.
"The Bravest Girl" is Ernst's second book. Her first book, "The Night Riders of Harpers Ferry," is also a fictionalized history of the Civil War era.
Both can be found at local bookstores or purchased through the publisher, White Mane Publishing in Shippensburg, Pa. at 1-717-532-2237.