1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

how to make .phar files unreadable?

Discussion in 'Development' started by r7vmc, Jul 30, 2017.

  1. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
  2. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    The best you can do is write your own obfuscator. If that's not an option, you can use any of several available online, but they are all easily reversed by online deobfuscators...
     
  3. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    how I write it?
     
  4. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    what about fopo.com.ar
     
  5. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    i have tried it but the plugin dosent work after restarting the pc
     
  6. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    FOPO works fine in mine PC
     
  7. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    did you restart and tried it?
     
  8. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    No, I dont use to restart my PC...
     
  9. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    thats why it works for you
     
  10. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    However, restarting my server doesn't make any issues with plugins that have hidden code with FOPO
     
    XenialDan likes this.
  11. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    i said restarting the pc not the server
     
  12. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Wtf :D Restarting PC does not make sense in plugin :D
     
  13. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    i know but idk why it dosent work after restarting
     
  14. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Have fun!
     
  15. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    that's look hard o_O
     
  16. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    SOFE messed up the formating either ways, it's impossible to hide your code while allowing it to run
    it's like being able to allow you to read the book without copying it
    there's some languages like python which generates a compiled bytecode("citation needed") which seem hard to read at first but if you are really determined you can still reverse engineer it
    you can try something like compression but they can unphar and they will get the same thing anyways
     
    r7vmc likes this.
  17. HBIDamian

    HBIDamian HBIDamian Staff Member

    Messages:
    365
    GitHub:
    HBIDamian
    Also, guys keep a note that if you are to success obfuscate your plugin, you should really have a licence on it that allows modification. For example that imagicalmine link above added that license. It’s kinda stupid. You are giving them permission to modify your plugin, but you don’t want them to see your code.

    Best to find a licence that denies modification, or stick to standard copyright. (Standard copyright is when you don’t add a license.)
     
    r7vmc likes this.
  18. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    OK, please decode this for me.
    [​IMG]
    Inspired by this xkcd:
    [​IMG]

    My point is, as long as your plugin is complicated enough, it is difficult to restore it to a human-readable source.

    The FOPO thing forces the server to decode, inflate, decompress, process and otherwise twist the piece of mess multiple times to get the final code to evaluate. Meanwhile, the Google.com one was merely optimized code (without trying to compress or otherwise encode the code) and it's already virtually impossible to figure out how it works.
    Honestly, if your plugin is complicated enough, only professional programmers could understand your code, and these are usually people who don't bother to read your source code because they can write much better and faster than you.
     
  19. skilastic

    skilastic Silverfish

    Messages:
    17
    There are 2 php encryption tools that may help. I use “phpencode.org” or “fopo.com.ar”
    if you have an Android device you can download Phar from the play store. In this way when people open your phar, it won’t show the code. They would have to extract it with eather dev tools or “pmt.haniokasai.com” I highly recommend “fopo.com.ar” because it’s very secure in encryption. Unlike “phpencode.org” having decoding websites. Fopo does not.



    I hope this helped ;)
     
  20. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    it's called obfuscation, or else the server need the key to decrypt the plugin to run it, which the decryption key also reveals the source
    anyways, if anyone have any suspicious obfuscated code just make a thread/profile post and you can be sure someone, at least someone will be willing to help you uncover what lies beneath
    obfuscation is making it hard to reverse, while still allowing the code to execute
    encryption is to make it impossible to reverse OR to execute unless the user knows the secret
     
    HimbeersaftLP likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.