I definitely wouldn't say I am certain I have a foolproof answer, otherwise the solution would probably already be apparent. What I am saying is, certainly, the problem is a difficult one.
I think the idea behind '1984', the book, (before I understood what terrorism was) only seemed a flippant idea propositioned as the plot of a fictional book. Surely no human being would ever consciously choose to govern the world (or their nation) in such a way, and even so they would likely be cut off early in the process if they tried.
Now with more life experience and knowledge of the current state of the world, I can only reason that '1984' makes complete and total sense once the concept of "terrorism" is understood to be the catalyst of such a movement.
Here are some basic scenarios:
1) Terrorism scares citizens and thus, as a knee-jerk reaction, wish to empower their government with omnipotent, omniscient, and omnipresent powers. The kinds of powers that any subsequent (corrupt) government could easily take advantage of.
2) Terrorism scares citizens, and as such citizens decide to be proactive to collaborate with their government to help prevent terrorists from causing harm to their nation and to make them as effective as they can possibly be, while at the same time working to preserve basic human rights such as the right to privacy.
3) Terrorism scares citizens. Knowing that entrusting their government with the kinds of powers they would need in order to act against terrorism would be overreaching, as such citizens decide their government should have no such powers and decide not to give their government God-like powers, while also deciding not to collaborate and blaming all failures on their government, and so citizens continue to live in a world of constant alertness and fear worrying that their next trip to the city could be their last...
Just like the Goldilocks fairy tale, I think the world is not looking for a solution that is "too hot" or "too cold". Rather we're all looking for the solution that is "just right". The specific solution I can't say I have the answer, but with continuous iteration and improvement I'm certain smart people can come to a sane (but more than likely imperfect) solution that does not violate any single group and their goals / objectives / rights. And at the same time does not necessarily handicap future generations with rules and regulations that are almost insurmountable should they find themselves ruled by a corrupt / power-hungry government.