“What we are asking them both is to restrain themselves, and then we see how to come back to that period of quiet," he said.
Prospects of restoring the Egyptian-brokered truce dimmed this week after Israeli soldiers killed three Hamas fighters who they said were trying to plant explosives along the Gaza-Israeli border.
Palestinian armed groups responded with rocket fire at southern Israel.
An Israeli air raid reportedly killed one Palestinian and injured several others near the town of Rafah in the southern Gaza Strip.
Livni, leader of Israel's ruling Kadima party who hopes to succeed Ehud Olmert, the Israeli prime minister, after the next elections, described the latest escalation as "unbearable".
"Hamas needs to understand that our aspiration to live in peace does not mean that Israel will take this kind of situation any longer. Enough is enough," Livni said in Cairo.
During her meeting with Mubarak, Livni said Israel must and would respond to protect its citizens.
Israel would not be deterred from acting because its February 10 elections are approaching, she said.
If Hamas thinks so, it is "wrong", Livni said.
Israel is running out of patience with Hamas, she said, calling the group an obstacle on the road to a Palestinian state.
Livni stressed that she didn't come to Egypt "to receive approval for a military operation" but "to discuss an intolerable situation for the citizens of Israel, and what Israel must do to protect its citizens".