"a military watchword, a signal given to a soldier on guard, with orders to let no one pass who does not first give that signal," 1590s, from Middle French contresigne, from contre- "against" (see contra-) + signe "sign" (see sign (n.)).
COUNTERSIGN. A watchword used by military bodies as a precaution against an enemy or enemies. The countersign may be changed at any moment, or any number of times, but is usually altered each twenty-four hours. It is given primarily to commanders of guards, and outposts and their sentries, to reconnoitring and visiting patrols, and to the field and regimental officer of the day. All others desiring to pass through the lines must first be supplied with the countersign, which is thus a guard against spies, strangers, and surprise. ["New International Encyclopaedia," 1906]