Cameron signed the book at the west London mansion flanked by French ambassador Sylvie Bermann while a police officer stood in the corner of the room.
"The people of the United Kingdom stand with the French people in shock, sadness and grief," Cameron wrote.
"We fly the French Tricolour as a symbol of our solidarity because we know our shared values - liberte, egalite, fraternite - will triumph over the evil faced in Paris last week," he added, underlining the word evil.