The European Court of Human Rights has found the Hungarian Government guilty of violating article eight of the European Convention of Human rights – ‘the right to privacy'.
The judgement was passed because of Hungary's failure to provide "sufficient precise, effective and comprehensive" measures that would limit surveillance to only people it suspected of crimes.
The case was brought forward by activists, Máté Szabó and Beatrix Vissy, who took the Hungarian government to the ECHR's Fourth Section over the law in 2014 on the grounds that it infringed their human rights.
The National Security Act of 2011 allows a minister of the government to approve a police request to search houses, mail, phones and laptops if it is for the purpose of protecting national security.
However, there is no judicial review or approval involved and the law does not limit the circumstances under which the surveillance can be ordered. Surveillance information gathered can be held for 90 days and extended by a further 90 days, and they aren't forced to delete it which effectively means it can be kept forever.
Ruling that the Hungarian law did not adequately protect its citizens from persistant surveillance, the court said that the government should be required to interpret the law more specifically and "verify whether sufficient reasons for intercepting a specific individual's communications exist in each case".
Individual cases must be looked at on a case-by-case basis, which is where mass surveillance fails - as hoovering up information over the internet and then searching for criminals in it becomes illegal.
The ECHR's Fourth Section also covers the UK, and the decision is likely to impact the Draft Investigatory Powers Bill, as it, too, would almost certainly violate article eight.
The ruling does not ban surveillance, or even require judicial oversight of such surveillance orders. But it is quite clear that such surveillance must be targeted at an individual and not used en masse against a population.
Although the decision cannot stop the UK government from passing the Draft Investigatory Powers Bill, the UK government can be taken to court for violating the European Convention.The government could choose to ignore this, but it would face fines and possible loss of international reputation.
The judgement has proved that the ECHR has a direct impact on EU member states, and as the UK has an upcoming referendum in 2016 on the UK's EU membership, privacy and mass surveillence may become a hot topic.
The Home Office were contacted for comments but did not respond in time for publication.
The British home secretary has previously stated that it would be a misrepresentation to suggest that UK authorities engage in the persistent mass collection of data on its citizens.