# How to protect the source code of an application created on Solar 2D from decompilation?

**URL:** <https://forums.solar2d.com/t/how-to-protect-the-source-code-of-an-application-created-on-solar-2d-from-decompilation/355733>\
**Category:** Other\
**Created:** [June 28, 2023, 9:10am UTC](https://forums.solar2d.com/t/how-to-protect-the-source-code-of-an-application-created-on-solar-2d-from-decompilation/355733 "2023-06-28T09:10:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![C2G](https://forums.solar2d.com/user_avatar/forums.solar2d.com/c2g/32/3908_2.png) [@C2G](https://forums.solar2d.com/u/C2G)\
**Post date:** [June 28, 2023, 9:10am UTC](https://forums.solar2d.com/t/how-to-protect-the-source-code-of-an-application-created-on-solar-2d-from-decompilation/355733/1 "2023-06-28T09:10:09Z")

</div>

There have already been many cases of decompilation of my applications…

---

<div class="post-metadata">

**Author:** ![Siu](https://forums.solar2d.com/user_avatar/forums.solar2d.com/siu/32/2129_2.png) [@Siu](https://forums.solar2d.com/u/Siu)\
**Post date:** [June 28, 2023, 11:21am UTC](https://forums.solar2d.com/t/how-to-protect-the-source-code-of-an-application-created-on-solar-2d-from-decompilation/355733/2 "2023-06-28T11:21:42Z")

</div>

You can’t really protect\* from de-compilation. As long as someone figures out the Corona Archive format, and maybe even easier now (if anything) since it’s all open source. But that’s the story (of reversing) with every engine/sdk/framework.

If you want to roll a different implementation, here’s one to try:

You can look into creating your own data structure for storing encrypted data (you’ll definitely want it encrypted), and have your bytecode-compiled Lua files there. They’ll be sitting outside the Corona Archive file (encrypted), but then the implementation for handling your custom data structure will be there; and at base case scenario not storing the encryption key there and have it fetched from a server.

Even after all of this, you’re basically just changing padlocks; that is creating a setting that’s different from all other Solar2D projects.

Side note: I haven’t tried storing compiled Lua files in this manner so I don’t know whether there would be issues.

---

<div class="post-metadata">

**Author:** ![C2G](https://forums.solar2d.com/user_avatar/forums.solar2d.com/c2g/32/3908_2.png) [@C2G](https://forums.solar2d.com/u/C2G)\
**Post date:** [June 28, 2023, 12:22pm UTC](https://forums.solar2d.com/t/how-to-protect-the-source-code-of-an-application-created-on-solar-2d-from-decompilation/355733/3 "2023-06-28T12:22:08Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://forums.solar2d.com/uploads/default/original/1X/1bf6a947166df24e92aaa3358558f4b82d7f3d5a.png) [@system](https://forums.solar2d.com/u/system)\
**Post date:** [December 25, 2023, 12:22pm UTC](https://forums.solar2d.com/t/how-to-protect-the-source-code-of-an-application-created-on-solar-2d-from-decompilation/355733/4 "2023-12-25T12:22:37Z")

</div>

Closed on December 25, 2023, 12:22pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
