Firstly, plugins go on Codecanyon NOT Themeforest
You cannot encrypt your code if you want to sell it on envato
Piracy etc. is an unfortunate downside to selling on stock marketplaces and for every potential solution there will be work around if someone really wants to rip items (not just on envato but across most marketplaces).
The best advice is to not become too hung up on it - it’s less common for people to rip plugins compared to other categories and at the end of the day if they really want to use yours then they will probably buy a copy even if they don’t then get your permission to include it in their item.
Focus on getting approved first. If you then release regular updates etc then that will at least make life complicated for anyone acting inappropriately