Keep it under your hat
This phrase meaning to keep a secret may originate from medieval archers who stored spare bowstrings under their hats to keep them dry. More likely, it simply refers to keeping something hidden in the most personal and private space — inside one's own hat, close to one's head and thoughts.