When M&M's were first invented, they were adopted by the military as it allowed soldiers to carry chocolate with them that wouldn't melt. It was even included as part of their rations.
Source
During the Cold War, CIA agents used a method of communication based on how their shoelaces were tied.Source