A way to enable data encryption by default (device to be encrypted on first boot) I did some research on data security that Android has in it's implementation FDE and FBE. I have a clear picture on how both work, but I need something a little different.

What is the best way to enable data encryption whether it is for Marshmallow (FDE) or Nougat or Oreo (FBE) on first boot? By first boot I mean to burn images on the Android device, and then turn it on. I'm not working on any mobile phone or something that is on the market.

What I want is that Android does data encryption on its own, immediately on first boot, and that later user is not prompted with a password. To have something like default password (which I notice exists in AOSP).

One more question: From Android's CDD I didn't notice that FBE is mandatory. Does that mean that FDE can also be used on Nougat and Oreo?

Thanks in advance.
Concerning the asking of password. When resetting Marshmallow, if the stock recovery is in place, it decrypts the phone and on first boot it encrypts it but well obviously never ask you for a password to start android because these two fine are recreated which hold device password:

/data/security/password.key
/data/security/pattern.key


If you could have been using TWRP to factory reset and you had a pattern or device assigned to device and you've opted for require password to start device, seamlessly, on any ROM and even TWRP itself. The password will exist even after resetting. The stock recovery is the only one that deals with that pattern at first boot.