I'm not a legal expert but as far as I know if the police are arresting you they can compel this in New Zealand. There is no difference in unlock methods. People get charges for not complying.
A person exercising a search power in respect of any data held in a computer system or other data storage device may require a specified person to provide access information and other information or assistance that is reasonable and necessary to allow the person exercising the search power to access that data.
Effectively, if the police search is otherwise legal, then they can compel you to unlock your phone. If you don't, you can get up to 3 months in prison:
178 Offence of failing to carry out obligations in relation to computer system search
Every person commits an offence and is liable on conviction to imprisonment for a term not exceeding 3 months who fails, without reasonable excuse, to assist a person exercising a search power when requested to do so under section 130(1).
A specified person may not be required under subsection (1) to give any information tending to incriminate the person.
But clarifies in 130 (3):
Subsection (2) does not prevent a person exercising a search power from requiring a specified person to provide information or providing assistance that is reasonable and necessary to allow the person exercising the search power to access data held in, or accessible from, a computer system or other data storage device that contains or may contain information tending to incriminate the specified person.
So basically, if the data used to unlock your phone can incriminate you, you don't have to provide it. But that doesn't protect you from incriminating evidence on your phone.
So I guess the moral of the story is that if you're a drug dealer, make sure your phone password is "ImADrugDealer" and then you can't be forced to provide that information. But I guess they can force you to unlock it without telling them the password? so I'm not sure what section 130 (2) had in mind.
This feels weird to me. If your password is "ILikePotato", which is then used to decrypt a text file that contains "IStoleTheMonaLisaAndReplacedItWithAPhotocopy", how is that any different in terms of "incriminating yourself" than if it was the other way around..?
And if you actually forgot your password, that's 3 months jail for you, because they'll hardly believe you? Better have just one so you'll surely remember!
I wonder, if you use special markings to keep track of your illegal doings, and one of your notebooks is found during a search, are you required to assist in deciphering the contents of it? That's basically the same thing as decrypting your hard drive.
If you have the Mona Lisa in your house then letting the police into your house incriminates you, but the whole point of the search is for them to be able to find it.
I think the right to remain silent was meant to protect us from being tortured, not as a shield to hide things?
But will you be punished for not telling them that the key is under the mat? They will get in either way. They can get into your hard drive with brute force too, it's just a wee bit more trouble for them.
I think the point is that you can grant them access in 3 seconds, it's not like you're giving an onerous task to someone.
While in implementation your notebook analogy may be right, in practice it's more similar to the police searching your house and asking you to unlock the basement so they can search there too. It's not exactly a big ask, it's as simple as unlocking it with the key you have, so from a legal perspective it's perfectly reasonable.
From a privacy perspective it's not great, but I'd argue the control should be on when someone is allowed to rummage through your stuff, it shouldn't matter if your notebook is physical or on your phone. Practicality changes this of course.
Forcing someone to unlock their phone after being arrested for something unrelated, is no different than them forcing you to unlock your house so that they can rifle through your stuff looking for additional things to charge you with. It's immoral, and it should be illegal. The government found new ways to circumvent people's rights with the digital world, and they're walking all over people's liberty.