Flash CM on encrypted phone running stock Android My Nexus 4 is currently running an encrypted Android 5.1.
Now I want to flash CM12. Can CM access my Data after flashing or do I need to remove the encryption before flashing?
In short, you will most likely lose all your data, because:


You have to unlock your bootloader when you install a third party ROM. Unlocking the bootloader will erase all your data.
The new installation might not be able to decrypt your data.
Even if it would work, it is still not recommended to keep all the data when installing a different version or make of a ROM.


You should make a backup of all your data, then format your phone.