How to resize the /data F2FS partition
As of today (May 30, 2016), the F2FS file system doesn't support shrinking. If it does by the time someone reads this, just let me know in the comments.

The solution is then to delete and re-create the entire filesystem for /data. From this related answer on Unix &amp; Linux Stack Exchange:

mkfs.f2fs /dev/block/mmcblk0p36 11583168


This will do the trick. After rebooting and restoring the backup, and finally, rebooting to Android, the encryption process worked.

Important: Be sure to check Use rm -rf instead of formatting from the TWRP settings prior to restoring the backup.