Keeping information secure in this age of laptop-lugging workers is the tech industry’s most formidable challenge, Microsoft Corp. Chairman Bill Gates said Tuesday.

Speaking to an annual gathering of 15,000 computer security experts in San Francisco, Gates invoked the metaphor of a medieval castle to explain the problem: Programmers build bigger moats and thicker fortress walls — but they don’t bother to protect the corporate crown jewels when members of their fiefdom exit the castle and leave the drawbridge open.