This guide describes how to make full backup of whole memory block.
My N5 is encrypted with Android 5.0. As far as I understand new mechanism, it envolves dependency on some external data taken from separate hardware component (part of encryption key). Is it guaranteed that it will not altered after I factory reset and flash Android 4.4 ? And even if it's ok, is it possible finally to restore such backup ? (May be /dev/mmcblck0 is read-only or otherwise restricted due to way hardware-accelerated encryption/decryption works.)