What kind of encryption method is this?

Discussion in 'PHP' started by W3Geek, Jul 7, 2011.

  1. #1
    What kind of encryption method is this? :confused: It's very easy to decode... but I do not know how to recrypt an URL using this method.

    
    ?><d4v 4d="f22t5rb2tt2m">
    (c) <?php bl2g4nf2('n1m5'); ?> - <1 hr5f="<?php bl2g4nf2('3rl'); ?>">h2m5</1> - <1 hr5f="<?php bl2g4nf2('3rl'); ?>/1b23t/">1b23t</1> - <1 hr5f="<?php bl2g4nf2('3rl'); ?>/3sc-aai7/">aai7</1> - <1 hr5f="<?php bl2g4nf2('3rl'); ?>/pr4v1cy/">pr4v1cy</1> - <1 hr5f="<?php bl2g4nf2('3rl'); ?>/t5rms/">t5rms</1> - <1 hr5f="<?php bl2g4nf2('3rl'); ?>/dmc1/">dmc1</1> - <1 hr5f="<?php bl2g4nf2('3rl'); ?>/c2nt1ct/">c2nt1ct</1> - p2w5r5d by <1 hr5f="https://www.5-j3nk45.c2m/5c2m/gb.php?cl=92152&c=4b&1ff=151532" t1rg5t="_bl1nk">w2rdpr5ss t3b5 th5m5</1>
    </d4v>
    
    </d4v>
    
    </d4v>
    
    PHP:
    The URL I'm trying to encryption using this method is a "affiliate link" to the owner's website with.
    
    https://www.5-j3nk45.c2m/5c2m/gb.php?cl=92152&c=4b&1ff=151532
    
    Code (markup):
    Thank you for you help.
     
    W3Geek, Jul 7, 2011 IP
  2. eleetgeek

    eleetgeek Peon

    Messages:
    129
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I used such method in my college.
    I am not sure, what you are trying to do. But, I will not hesitate from giving links.
    Google for preg replace and try to crack the regex they are using. Just find that function :)

    Or, what are you trying to do anyway?
     
    eleetgeek, Jul 7, 2011 IP
  3. W3Geek

    W3Geek Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The owner of the script that I'm using has locked down anyone from changing the footer. He has double encrypted it with a base64 method and whatever this gibberish is. When I purchased the script a few months ago I got an affiliate link to go with my account. I could use that affiliate link to earn 70% of the traffic sales I sent to his website... However, with this method blocking me I cannot encode the URL above to match the encoding on that script. I do not mind to linking back to him I just wanna earn something from it. ;)
     
    W3Geek, Jul 7, 2011 IP
  4. elixiusx

    elixiusx Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Result:
    
    ?><div id="footerbottom"> (c) <?php bloginfo('name'); ?> - <a href="<?php bloginfo('url'); ?>">home</a> - <a href="<?php bloginfo('url'); ?>/about/">about</a> - <a href="<?php bloginfo('url'); ?>/usc-aai7/">aai7</a> - <a href="<?php bloginfo('url'); ?>/privacy/">privacy</a> - <a href="<?php bloginfo('url'); ?>/terms/">terms</a> - <a href="<?php bloginfo('url'); ?>/dmca/">dmca</a> - <a href="<?php bloginfo('url'); ?>/contact/">contact</a> - powered by <a href="https://www.e-junkie.com/ecom/gb.php?cl=9oaeo&c=ib&aff=aeaeuo" target="_blank">wordpress tube theme</a> </div> </div> </div>
    
    PHP:
    I develop a script to decrypt this... is very easy:

    
    <?php
    
    $code = '?><d4v 4d="f22t5rb2tt2m">
    (c) <?php bl2g4nf2(\'n1m5\'); ?> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>">h2m5</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/1b23t/">1b23t</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/3sc-aai7/">aai7</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/pr4v1cy/">pr4v1cy</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/t5rms/">t5rms</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/dmc1/">dmc1</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/c2nt1ct/">c2nt1ct</1> - p2w5r5d by <1 hr5f="https://www.5-j3nk45.c2m/5c2m/gb.php?cl=92152&c=4b&1ff=151532" t1rg5t="_bl1nk">w2rdpr5ss t3b5 th5m5</1>
    </d4v>
    
    </d4v>
    
    </d4v>';
    
    $conver = array(
    	4 => 'i',
    	3 => 'u',
    	2 => 'o',
    	1 => 'a',
    	5 => 'e'
    );
    
    $final = '';
    for( $x=0;$x<strlen($code);$x++ )
    {
    	$encoded = false;
    	foreach( $conver as $key => $val )
    	{
    		if( $code[$x]==$key )
    		{
    			$encoded = true;
    			$final .= $val;
    			break;
    		}
    	}
    	
    	if( !$encoded )
    		$final .= $code[$x];
    }
    
    print htmlentities($final);
    
    ?>
    
    PHP:
     
    elixiusx, Jul 7, 2011 IP
  5. SiJz

    SiJz Peon

    Messages:
    51
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That's one way.. but there are two simpler ways:

    Decode - pop it into notepad and replace 4 with i, 2 with o, 5 with e, 3 with u and 1 with a
    Encode - pop it into notepad and replace i with 4, o with 2, e with 5, u with 3 and a with 1

    or

    
    <?php
    
    // decode
    $in = '?><d4v 4d="f22t5rb2tt2m">(c) <?php bl2g4nf2(\'n1m5\'); ?> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>">h2m5</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/1b23t/">1b23t</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/3sc-aai7/">aai7</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/pr4v1cy/">pr4v1cy</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/t5rms/">t5rms</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/dmc1/">dmc1</1> - <1 hr5f="<?php bl2g4nf2(\'3rl\'); ?>/c2nt1ct/">c2nt1ct</1> - p2w5r5d by <1 hr5f="https://www.5-j3nk45.c2m/5c2m/gb.php?cl=92152&c=4b&1ff=151532" t1rg5t="_bl1nk">w2rdpr5ss t3b5 th5m5</1></d4v></d4v></d4v>';
    $in=str_replace('1','a',$in);
    $in=str_replace('2','o',$in);
    $in=str_replace('3','u',$in);
    $in=str_replace('4','i',$in);
    $in=str_replace('5','e',$in);
    print $in;
    
    print "<br><br>";
    
    // encode
    // dont forget to add \ before any ' in the line to be encoded - you can do this in notepad by replacing ' with \'
    $in='?><div id="footerbottom">(c) <?php bloginfo(\'name\'); ?> - <a href="<?php bloginfo(\'url\'); ?>">home</a> - <a href="<?php bloginfo(\'url\'); ?>/about/">about</a> - <a href="<?php bloginfo(\'url\'); ?>/usc-aai7/">aai7</a> - <a href="<?php bloginfo(\'url\'); ?>/privacy/">privacy</a> - <a href="<?php bloginfo(\'url\'); ?>/terms/">terms</a> - <a href="<?php bloginfo(\'url\'); ?>/dmca/">dmca</a> - <a href="<?php bloginfo(\'url\'); ?>/contact/">contact</a> - powered by <a href="https://www.e-junkie.com/ecom/gb.php?cl=9oaeo&c=ib&aff=aeaeuo" target="_blank">wordpress tube theme</a></div></div></div>';
    $in=str_replace('a','1',$in);
    $in=str_replace('o','2',$in);
    $in=str_replace('u','3',$in);
    $in=str_replace('i','4',$in);
    $in=str_replace('e','5',$in);
    print $in;
    ?>
    Code (markup):
    As for the aff code part (?cl=92152&c=4b&1ff=151532 ==> ?ca=92152&c=4b&aff=151532 )
    I'd assume that there is no encoding on the number part, so run the encode pass above - either way as shown, then manually edit it to have the two numeric values required.


    Si
     
    Last edited: Jul 7, 2011
    SiJz, Jul 7, 2011 IP
  6. elixiusx

    elixiusx Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #6
    Ah... I don't know in what i was thinking...

    your method is better... :)
    str_replace( array(1,2,3,4,5), array('a','o','u','i','e'), $data );
     
    elixiusx, Jul 7, 2011 IP
  7. elixiusx

    elixiusx Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #7
    W3Geek you should use the SiJz method...
     
    elixiusx, Jul 7, 2011 IP
  8. W3Geek

    W3Geek Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Something I need to point out @elixiusx,

    There is a line in this code that is not right not right.
    
    ?><div id="footerbottom"> (c) <?php bloginfo('name'); ?> - <a href="<?php bloginfo('url'); ?>">home</a> - <a href="<?php bloginfo('url'); ?>/about/">about</a> - <a href="<?php bloginfo('url'); ?>/usc-aai7/">aai7</a> - <a href="<?php bloginfo('url'); ?>/privacy/">privacy</a> - <a href="<?php bloginfo('url'); ?>/terms/">terms</a> - <a href="<?php bloginfo('url'); ?>/dmca/">dmca</a> - <a href="<?php bloginfo('url'); ?>/contact/">contact</a> - powered by <a href="https://www.e-junkie.com/ecom/gb.php?cl=9oaeo&c=ib&aff=aeaeuo" target="_blank">wordpress tube theme</a> </div> </div> </div>
    
    Code (markup):
    This line...
    
    <a href="<?php bloginfo('url'); ?>/usc-aai7/">aai7</a>
    
    Code (markup):
    Some how the line above is equivalent to "USC-2257". Even though "a = 1" it doesn't work out like that. Look over it again... and "i = 4" but somehow in the line above "i equals 5". I don't know if you can see what I am talking about or not but this is whats stopping me from encoding the affiliate link with this method.

    I tried to leave "my" affiliate as is... but it doesn't work it gives me;

    https://www.5-j3nk45.c2m/5c2m/gb.php?cl=9oaeo&c=4b&1ff=aeaeuo
    Code (markup):
    Whenever I try using that URL in the encoding it does work... it ends up with something like "ib&aff=262643". All I know is that I need some help with this immediately.
     
    W3Geek, Jul 8, 2011 IP
  9. skynight007

    skynight007 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    aye i know this encoding. Nothing like leftover encryptions
     
    skynight007, Jul 9, 2011 IP
  10. skynight007

    skynight007 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    they make it seem so tricky but if you look closlye you can tell what letters go where. I use to get this alot on my wordpress themes so now i know all about it. :)

    1ll k1ll y5o
     
    skynight007, Jul 9, 2011 IP
  11. SiJz

    SiJz Peon

    Messages:
    51
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I've come across this a lot in the last day or so since replying to this post.

    the bit that's missing is this:

    
    $X=strtr($X,'123456aouie','aouie123456');
    
    Code (markup):
    where $X is the base64 decoded string or output from $X=base64_decode("encoded data")

    Si
     
    SiJz, Jul 9, 2011 IP
  12. W3Geek

    W3Geek Guest

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    That was in a separate part of the base64 footer file. I just gave up with trying to encode that long affiliate link... something in that URL kept throwing the '123456aouie' method off and making it to where it would only work like '23456aouie'. 2 = a, 3 = o, 4 = u, 5 = i, and 6 = e. I could not get one to save my life. I just shortened the 'URL' with TinyURL and made it to a LinkBucks link. It works now. =)

    I would still love to figure out what people call this method. Its interesting.
     
    W3Geek, Jul 9, 2011 IP
  13. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #13
    Interesting, I never saw people actually uses this method to encrypt their codes.

    And surprisingly, I made a String Replacer tool in my php playground site on last year July which can do decryption for this. I never thought that my tool (came out of random idea) would have its own use, until I saw this thread.

    This link would add the replacement rules automatically after load.

    This thread just gave me an idea to allow user to swap the replacement rules. (used for encryption)

    Cheers.
     
    Last edited: Jul 10, 2011
    ads2help, Jul 10, 2011 IP