// you’re reading...

coding

Encrypt PHP Source with Your Own Algorithm Level 1

Chronological :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You know that there’re a lot of stuff which can encrypted php source
zend,ioncube,etc.., some of these encryptor use some dynamic link library file in they server
to make the encrypted file works, i thought its really waste time :D
coz there’re many ways to make encrypted source, probably the zend,ioncube, or of a kind using dll file just
to make sure none know the algorithm to encrypt the string, and i thought all of this kind use return(eval(theysource)) while the end :P
i mean they probably most used “eval” function at the end :P ( just thought only, no more reason ;P )

i will show you how to make a simple encrypted source code from php algorithm
i will use 3 initiation :D

1. first is variable which contain the encrypted source by base64_encode and a little strtr function
2. second is variable which contain the strrev function ( these just to make the “reader source” a little confuse, and you shouldn’t confuse because these :P )
3. third is variable which contain the eval and encrypted code which will be used to decode the string from the first step

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

here we go

now i would like to make a phpinfo(); code in test.php file

before :
——

phpinfo();

after :
——
$_X='cGhwaW5mbygpOyA=';
$_D=strrev('edoced_46esab');
eval($_D('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTsgJF9YPXN0cnRyKCRfWCwnIScsJyAnKTskcmVzdWx0PSRfWDtldmFsKCRyZXN1bHQpOyRfWCA9IDA7JHJlc3VsdCA9IDA7'));

how to change like these ??

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

here we go ;
————————————————————-
the string “phpinfo();” has been changed by two operations
1. encoded by base64_encode
2. strtr(base64_encode(”phpinfo();”),’ ‘,’!') // these seems like replace character 1by1 which exact same as it declared

then it changed to : ‘cGhwaW5mbygpOyA=’
————————————————————-

————————————————————-
strrev mean such as reverse the place of character, example : ‘budi’ -> ‘idub’
so you should know now what these used for ;)
————————————————————-

————————————————————-
eval(base64_decode(’JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTsgJF9YPXN0cnRyKCRfWCwnIScsJyAnKTskcmVzdWx0PSRfWDtldmFsKCRyZXN1bHQpOyRfWCA9IDA7JHJlc3VsdCA9IDA7′));
mean there is some code inside after you decode the string
here are the code :

$_X=base64_decode($_X); << first encoding
$_X=strtr($_X,’!',’ ‘); << second encoding
$result = $_X; << declare
eval($result); << run da shitz
$_X = 0; << to make sure that the administrator of your hosting didnt sniff your code easily :D
$result = 0; << idem
————————————————————-

RESULT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if the variable $_X contained by ‘cGhwaW5mbygpOyA=’ which mean “phpinfo();” that has been encoded by 2 operation (base64 and strtr), we will see the full of source like these

$_X=’cGhwaW5mbygpOyA=’;
$_X=base64_decode($_X);
$_X=strtr($_X,’!',’ ‘);
$result = $_X;
eval($result);
$_X = 0;

same as like these

$_X=’cGhwaW5mbygpOyA=’;
$_D=strrev(’edoced_46esab’);
eval($_D(’JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTsgJF9YPXN0cnRyKCRfWCwnIScsJyAnKTskcmVzdWx0PSRfWDtldmFsKCRyZXN1bHQpOyRfWCA9IDA7JHJlc3VsdCA9IDA7′));

and also same as like these one :P

phpinfo();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Lol, now i hope you got what all these talkin about -_-’,
I just thought that all encryption machine seems like these algorithm but they use C++ to compile and protect they code, and make some changed in placement code,
here i just used the base64 encoding so its very weak, then you could use your strength algorithm to encrypting, and
thanx for all nullers scripts cuz give me idea to wrote these all :D, keep your professional . . . .

Discussion

12 comments for “Encrypt PHP Source with Your Own Algorithm Level 1”

  1. if you would like take a look
    see these one :
    http://h1.ripway.com/tesaja/yukmari1.php
    ——-
    paste your code without < ? and ?> either
    test on your localhost
    have fun ;)

    Posted by iFX | July 4, 2008, 4:31 pm
  2. pusing gw baca nya kalo pake bahasa inggris, capek lah…, keburu males mata gw,…..

    Posted by malaikat | July 5, 2008, 2:22 am
  3. learn om :D

    Posted by iFX | July 5, 2008, 8:15 am
  4. stop… aq buka kamus dulu yah

    Posted by petunia | July 6, 2008, 12:18 am
  5. kk ifx ngedate yukkk…. pengin ngedate ama kk

    Posted by muachh | July 6, 2008, 2:08 am
  6. ifx, keep posting. I miss U, ol dong :D

    Posted by bennya ad | July 6, 2008, 12:02 pm
  7. wew,cool
    nice article brotha…

    it’s great ide for me, can i add your credit to my source?

    ehetekeneme

    Posted by Bithedz | July 9, 2008, 12:31 am
  8. ajarin pls…………….

    Posted by irvian | July 9, 2008, 6:32 am
  9. @bithedz : up2U kk ^^
    @irvian : capung de

    Posted by iFX | July 9, 2008, 2:55 pm
  10. Hi,
    Is there any standard method to protect php source code?

    The encoding is a good solution , but please write a complete sample way.

    thnx
    kevin

    Posted by kevin | October 5, 2008, 4:37 pm
  11. @kevin : you should use commercial product such as ioncube, etc . . .
    and i’ve been wrote complete sample way of your request above.

    ;)

    Posted by iFX | October 5, 2008, 5:12 pm
  12. omz, pake bahasa jawa aja nape? :D

    Posted by syntax_error | October 15, 2008, 9:43 pm

Post a comment

Categories

    Counter Ajah