Mary, Queen of Scots spent almost 20 years in captivity. She was held in various locations across Britain from 1568 until her execution on February 8 1587.

Mary was aware that her letters were routinely read by her jailers and passed on to be scrutinised by Elizabeth I’s closest advisers, notably William Cecil. At times, she was forced to rely on clandestine techniques, including writing in invisible ink. She wrote that “although such artifices be very hazardous and vulgar, they will serve me in extreme necessity”.

Mary also used complex ciphers to disguise the contents of her correspondence, especially when she wished to discuss plots designed to set her free. Hundreds of her coded letters survive in different forms (as copies, translations, and originals), many of them from supporters who were directly involved in schemes including the Babington plot of 1586, which aimed to assassinate Elizabeth I and replace her with Mary.