The government has struck a deal with Labor, which will allow police and spy agencies to access encrypted messages on apps such as Wickr and Whatsapp.

Attorney-General Christian Porter called the deal a massive win, saying terrorism and child sex offences are being facilitated by criminal groups communicating on encrypted apps.

He added law enforcement and ASIO had informed him that the legislation was not necessary to give them an edge, but a fighting chance.