I’d like to let “the cat out of the bag,” but golly, I can’t:
The derivation of the phrase is not clear. One suggestion is that the phrase refers to the whip-like “cat o’nine tails,” an instrument of punishment once used on Royal Navy vessels. The instrument was purportedly stored in a red sack, and a sailor who revealed the transgressions of another would be “letting the cat out of the bag.” Another suggested derivation is from the “pig in a poke” scam, where a customer buying a suckling pig in a sack would actually be sold a (less valuable) cat, and would not realise the deception until the bag was opened.
Both of these suggestions are rejected by Snopes.com, who find no evidence of it originating in naval slang, nor of whips being stored in sacks, and consider it “nigh on impossible to mistake a cat for a pig.”
I favor the naval version myself. Your guess may be better than mine.