Results 1 to 2 of 2

Thread: base_64 encoding an entire page

  1. #1
    Join Date
    Sep 2010
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default base_64 encoding an entire page

    Hi folks!

    Can anybody provide some good tips on mega strong base_64 encoding of an entire page? Perhaps ways to replace characters to make it even harder to decode for the user?

    The reason i'm doing this is because i'm doing some freelancing work, and my client at the moment doesn't feel comfortable paying me until the job is 100% done, and he has agreed that it is fair for me to install an encrypted version on his webserver, then once he's confirmed it's all fine he will pay me then i will replace it with the decrypted version.

    Thanks guys!
    -Ollie

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    perhaps something like this
    PHP Code:
    <?php

    $script 
    file_get_contents('path/to/script.php');
    $encoded base64_encode($script);
    $encodedscript '$decoded = base64_decode($encoded); eval($decoded);';
    file_put_contents('path/to/base64script.php'$encodedscript);

    ?>
    ? Completely untested.

    Honestly, though, this is how it goes: the client pays, then he gets the product. If he wants to see that it works beforehand, maybe you could host a demo for him.

    It's not rude or a ripoff. It's practical. If you deliver a script, the client has it. You can't take it back. Even encoding it like this isn't all that helpful. If the client doesn't trust you enough to pay you, that is where the problem is.

    Edit:

    This works, with a few restrictions:
    PHP Code:
    <?php

    $script 
    file_get_contents('weird.php');
    $encoded base64_encode($script);
    $encodedscript '<?php $decoded = base64_decode("'.$encoded.'"); eval($decoded); ?>';
    file_put_contents('tooweird.php'$encodedscript);

    ?>
    First, I had to fix a few syntax errors. Note, in particular, that $encoded (inside base64_decode()) is now "quoted" correctly.
    Second, (assuming this is a php script), the $encodedscript needs to have <?php ?> tags.
    Third (and therefore), the script being encoded can not have <?php ?> tags, as they would create a parse error. You might be able to solve that like this:
    PHP Code:
    $encodedscript = '<?php $decoded '?>'.base64_decode("'.$encoded.'").'<?php'; eval($decoded); ?>';
    But I think things are getting silly at this point.
    Last edited by traq; 10-16-2010 at 04:21 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •