The Home Office is to consult on new ways to protect the public sector and others from ransomware attacks.