Brooks, who is on trial alongside seven other defendants, has pleaded not guilty to charges related to phone-hacking at the News of the World tabloid when she was editor, illegal payments to officials for stories and impeding police inquiries.
The prosecution told the jury earlier in the trial that the comments made by Brooks to Cook over lunch in 2005 about intercepting voice mails showed the editor had known that phone-hacking was going on under her watch. Brooks denies this.
Brooks' lawyer Jonathan Laidlaw accused Cook of making up the conversation and other details about the lunch, a suggestion Cook denied.
Brooks, known as Rebekah Wade prior to her second marriage in 2009, was editor of the now-defunct Sunday tabloid News of the World, then of its sister daily paper the Sun, before rising to be chief executive of News International, the British newspaper arm of Murdoch's News Corp empire.
Appearing as a prosecution witness, Cook was asked about an occasion in September 2005 when she and Brooks had lunch along with two of Cook's friends, a couple called the Manoukians.
"The bit I remember the most is the topic of how easy it is to listen to other people's voice mails as long as they haven't changed their factory-setting pin codes," Cook told the court. Asked who had said that, she answered, "Rebekah".
"She said she couldn't believe that famous people who have all those advisers didn't know you have to personalise your pin codes to make their voice mail secure," Cook said, when asked to elaborate on how Brooks had expressed herself.
Cook also said that while discussing this topic, Brooks had recounted "in parenthesis" a story about Paul McCartney and his then-fiancee Heather Mills having a row in a hotel that had resulted in an engagement ring being thrown out of the window.
"I was under the impression she was talking about Paul McCartney's phone that hadn't had its pin code changed," Cook said.
Asked to describe Brooks' attitude while talking about these matters, Cook said, "Quite flippant".
"She told me how ludicrous it was how people weren't aware of the simple way to protect the privacy of their mobiles."
Laidlaw accused Cook of telling lies to the jury.
Cook had told the court earlier that Brooks had talked during the lunch about a recent row between herself and her then-husband, actor Ross Kemp, which had been reported in her own newspaper, the Sun. Cook said Brooks had laughed about this.
Laidlaw put it to her that an alleged assault by Brooks on Kemp that was reported in the newspapers did not take place until several weeks after the lunch, so her account of what Brooks had said could not possibly be true.
Cook did not offer any explanation for the discrepancy in the dates but stuck by her story. "I did not make it up. I have no grievance against Mrs Brooks whatsoever," she said.
Laidlaw also accused Cook of making up the specific comments about phone-hacking. Cook also denied that.
The trial continues.