Along the lines of Q's answer, it's been reported that the line was also in a James Bond movie... perhaps 'Dr. No'... but I haven't found real support for that conjecture...
no, I don't think it's that old, Clanad - I think it would probably be 1980s at the earliest. I can't supply a source, though. It's spoken by people pretending to be secret agents or the like.
I don't know about that particular expression but a surprising number of similar clever secret agent quips can be traced to the ultimate secret agent. Agent 86, Maxwell Smart of Control in the timeless 60s classic television show, Get Smart.
"If I told you I would have to kill you", sounds very much in Don Adam's style.
Re my earlier answer and if you're interested, Top Gun is on Film Four at 9 pm this evening. Watching that might show whether Tom Cruise actually DID use these words. The film was made in 1986, but of course that does not mean it appeared there first.