The Liberal Democrats will introduce a bill of digital rights within the first six months of the next parliament if they enter government as part of a coalition after the general election.

The bill, which would be introduced through an act of parliament, would aim to ensure that civil and human rights that apply to the physical world also apply online, and it would also seek to establish key rights that specifically apply to the digital sphere.

“The way in which we work, socialise, buy products and use services has changed at lightning speed since the digital revolution,” said Nick Clegg, announcing the policy.

“However, government and politicians have responded at snail’s pace, with a poor understanding of new technology and the impact it is having on our lives. We need to ensure that consumers, businesses, journalists and our children are protected in the online world.”

The party has launched a public consultation paper on the bill, which includes more powers for the information commissioner to inspect companies that break data laws; legal rights for consumers to get compensation when companies use deliberately misleading or unreadable terms and conditions online; and prison sentences for companies conducting large-scale data theft and illegally selling personal data.

The proposals come after a series of news reports in the Daily Mail that revealed private companies have been selling the details of people’s pension pots, in breach of data protection law.

The party’s plans build on those shared with the Guardian in March to enshrine in law the responsibility of government to defend a free press, including the rights of journalists and citizen journalists to express their views freely online.

The proposed bill of digital rights would ensure that newspapers and other media were not required to rely solely on the right to freedom of expression spelled out under article 10 of the European convention on human rights, which many argue does not provide enough protection to journalists.

The consultation paper also says that state surveillance of the internet must be the exception rather than the norm, and “must only take place where it is clearly justified for the protection of the public and in accordance with the fundamental principles of necessity and proportionality”.

The document also states that the government has a responsibility to “uphold and facilitate the strongest security standards online” and should not seek to weaken encryption or “obstruct the availability of encryption technologies”.