Prevent esp32 firmware against flash reading

I am using esp32 for a project and I want to prevent my firmware against flash reading. is there a way or an example for this? I tried flash encryption solution given by espressif several times and it didn’t work for me.

That’s the only thing that makes sense. Please specify exactly what you tried and what errors it gave you.

I tried that several times and now flash encryption is working properly with a custom partition table. I added OTA updates as well. but now when I try flash esp32 with OTA it gives an error saying wrong magic byte

I can’t find what’s the matter with it.

This is my custom partition table.