This code asks for password only for the last node and its ket, right? Do you assume all nodes uses the same key? There should be some way to use different keys for each node (it is there already, there is an option for this purpose) but if all of them have different password it will still be failing.
You can create only an issue for it because it works ok now for single key projects.