How to downgrade from Android 5 to 4.4.4 on an encrypted phone? After certain troubles with Android 5 (see How to fix file permissions on Android 5 so that a certain app can access certain files?) I decided to go back to 4.4.4 on my Nexus 4 for the time being. Thereto, I restored a backup I made prior to upgrading using the TWRP 2.8.2 restore function. The restore in itself went well, and after reboot the familiar 4.4.4 boot animation came up.

But when I entered my encryption password, I immediately (no discernible delay) got a "Try Again" message. I retried several times, but my password wasn't accepted. It was definitely the correct password I entered, for in TWRP, it works.

I now restored Android 5 from a backup I made immediately before restoring Android 4.4.4, and my password is accepted again, but of course the Android 5 problems are back as well.

So: how do I properly downgrade to 4.4.4 on my encrypted Nexus 4? Thanks.
In L, take a backup of things you want to save (photos, videos, app data, etc)
Go download a stock rom for your device, such as this one
In TWRP, wipe data, system, cache and dalvik cache
On your computer use fastboot to flash the system.img 
Reboot
You should now boot into kitkat, without any encryption.
Restore any backups you might've had. Note that if you simply backed up the /data partition, that might cause problems when restored.

7b. If you did create a backup with twrp, you can still restore in a safe way
with titanium backup pro, assuming you root the device.