Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4234688
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:23:27+00:00 2026-05-21T02:23:27+00:00

Can someone explain me how http://utf-8.jp/public/jjencode.html works and if is good to use it

  • 0

Can someone explain me how http://utf-8.jp/public/jjencode.html works and if is good to use it on my code? The first time I tried it I thought that I needed to have some kind of algorithm in my code to use it, but it works on every site. What is happening?

I already read the source code but I don’t understand it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:23:27+00:00Added an answer on May 21, 2026 at 2:23 am

    Here is the commented script
    http://corkami.googlecode.com/svn-history/r399/trunk/misc/jjencode.txt

    // this is a commented source of a jjencode script
    // jjencode, http://utf-8.jp/public/jjencode.html
    
    // reference: Peter Ferrie, 2011, http://pferrie2.tripod.com/papers/jjencode.pdf
    
    // for reference,
    // alert("Hello, JavaScript" )
    // is encoded as 
    
    // $=~[];$={___:++$,$$$$:(![]+"")[$],__$:++$,$_$_:(![]+"")[$],_$_:++$,$_$$:({}+"")[$],$$_$:($[$]+"")[$],_$$:++$,$$$_:(!""+"")[$],$__:++$,$_$:++$,$$__:({}+"")[$],$$_:++$,$$$:++$,$___:++$,$__$:++$};$.$_=($.$_=$+"")[$.$_$]+($._$=$.$_[$.__$])+($.$$=($.$+"")[$.__$])+((!$)+"")[$._$$]+($.__=$.$_[$.$$_])+($.$=(!""+"")[$.__$])+($._=(!""+"")[$._$_])+$.$_[$.$_$]+$.__+$._$+$.$;$.$$=$.$+(!""+"")[$._$$]+$.__+$._+$.$+$.$$;$.$=($.___)[$.$_][$.$_];$.$($.$($.$$+"\""+$.$_$_+(![]+"")[$._$_]+$.$$$_+"\\"+$.__$+$.$$_+$._$_+$.__+"(\\\"\\"+$.__$+$.__$+$.___+$.$$$_+(![]+"")[$._$_]+(![]+"")[$._$_]+$._$+",\\"+$.$__+$.___+"\\"+$.__$+$.__$+$._$_+$.$_$_+"\\"+$.__$+$.$$_+$.$$_+$.$_$_+"\\"+$.__$+$._$_+$._$$+$.$$__+"\\"+$.__$+$.$$_+$._$_+"\\"+$.__$+$.$_$+$.__$+"\\"+$.__$+$.$$_+$.___+$.__+"\\\"\\"+$.$__+$.___+")"+"\"")())();
    
    
    // preliminary points
    
    // (a + "") gives the string representation of a
    
    // [] = empty array. 0 by value, -1 with ~ => ~[] = -1
    // as a string, ![] gives  'false'
    
    // {} = empty object.
    // as a string, {} gives '[object Object]'
    
    // if a is a x-long array, a[x] is 'undefined' as a string. same for absent properties.
    
    // "" is an empty string. !"" returns 'true' as it is indeed 'null'
    
    
    // now let's start with the actual code
    
    // creating $ variable with a value.
     $=~[]; // $ = -1
    
     // defining properties of a $ object.
     $ =
     {
       ___:++$,             // 0, $ = 0
    
       $$$$:(![] + ””)[$],        // 0th char of 'false',           => 'f'
    
       __$:++$,             // 1, $ = 1 now...
    
       $_$_:(![] + ””)[$],        // 1st char of 'false'            => 'a'
    
       _$_:++$,             // 2...
    
       $_$$:({} + ””)[$],         // 2nd char of '[object Object]'  => 'b'
    
       $$_$:($[$] + ””)[$],       // 2nd char of 'undefined'        => 'd'
    
       _$$:++$,             // 3...
    
       $$$_:(!”” + ””)[$],        // 3rd char of 'true'             => 'e'
    
       $__:++$,             // 4
    
       $_$:++$,             // 5
    
       $$__:({} + ””)[$],         // 5th char of '[object Object]'  => 'c'
    
       $$_:++$,             // 6
    
       $$$:++$,             // 7
    
       $___:++$,            // 8
    
       $__$:++$             // 9
     };
    
    // => in order, ___, __$, _$_, _$$, $__, $_$, $$_, $$$, $___, $__$, $_$_, $_$$, $$__, $$_$, $$$_, $$$$ are now equal to 0...F,
    // note they are just binary numbers with character substitution
    
    $.$_ =
        ($.$_ = $ + ””)[$.$_$] +              // 5th character of '[object Object]'  => $.$_ = 'c'
        ($._$ = $.$_[$.__$]) +                // 1st character of ...                => $._$ = 'o'
        ($.$$ = ($.$ + ””)[$.__$]) +          // 1st char of 'undefined'             => $.$$ = 'n'
        ((!$) + ””)[$._$$] +                  // 3rd char of 'false'                 => 's'         // poor s, we don't save it...
        ($.__ = $.$_[$.$$_]) +                // 6th char of '[object Object]'       => $.__ = 't'
        ($.$ = (!”” + ””)[$.__$]) +           // 1st char of 'true'                  => $.$  = 'r'
        ($._ = (!”” + ””)[$._$_]) +           // 2nd char of 'true'                  => $._  = 'u'
        $.$_[$.$_$] +                         // 5th char of '[object Object]']      => 'c'         // hey, we already have a c !
        $.__ +                                // 't'
        $._$ +                                // 'o'
        $.$;                                  // 'r'
    
    // => $.$_ = 'constructor'
    
    
    $.$$ =
        $.$ +                       // 'r'
        (!”” + ””)[$._$$] +         // 'true'[3] => 'e'
        $.__ +                      // 't'
        $._ +                       // 'u'
        $.$ +                       // 'r'
        $.$$;                       // 'n'
    
    $.$ =
        ($.___)[$.$_][$.$_];        // (0)[constructor][constructor]
    
    
    // summary of $ at this point
    
    // $ = {}
    // $.___  = '0';
    // $.__$  = '1';
    // $._$_  = '2';
    // $._$$  = '3';
    // $.$__  = '4';
    // $.$_$  = '5';
    // $.$$_  = '6';
    // $.$$$  = '7';
    // $.$___ = '8';
    // $.$__$ = '9';
    // $.$_$_ = 'a';
    // $.$_$$ = 'b';
    // $.$$__ = 'c';
    // $.$$_$ = 'd';
    // $.$$$_ = 'e';
    // $.$$$$ = 'f';
    
    // $.$_ = 'c'
    // $._$ = 'o'
    // $.$$ = 'n'
    // $.__ = 't'
    // $.$  = 'r'
    // $._  = 'u'
    
    // $.$_ = 'constructor';
    // $.$$ = 'return';
    // $.$ = (0)[constructor][constructor]
    
    
    
    // and finally, the only line of call
    
    $.$(
        $.$(
            $.$$ + ”\”” + ENCODED + ”\””
            )()
        ) ();
    
    //
    (0)[constructor][constructor](
        (0)[constructor][constructor](
            return + " + ENCODED + "
            )()
        )()
    
    // 'equivalent' to eval(eval(ENCODED))
    
    
    // encoding
    // !"#$%&’()*+,-./:;<>=?@[]^_`{|}~  as is
    // 0123456789abcdeftou => as $ properties. Ex : 'babe' = $.$_$$ + $.$_$_ + $.$_$$ + $.$$$_
    // other ascii chars: as \xxx (octal) encoding. Ex: 'A' = char(65) = \101 = "\\" + $.__$ + $.___ + $.__$
    // unicode chars as \u????. ex: 'sea', \u6d77 as "\\" + $._ + $.$$_ + $.$$_$ + $.$$$ + $.$$$
    
    // so in the end, it's just defining a $ object and executing an eval on a string, that is built character by character.
    
    // to confirm, here is a small imperfect python decryption script
    
    // import sys
    // start = r'$=~[];$={___:++$,$$$$:(![]+"")[$],__$:++$,$_$_:(![]+"")[$],_$_:++$,$_$$:({}+"")[$],$$_$:($[$]+"")[$],_$$:++$,$$$_:(!""+"")[$],$__:++$,$_$:++$,$$__:({}+"")[$],$$_:++$,$$$:++$,$___:++$,$__$:++$};$.$_=($.$_=$+"")[$.$_$]+($._$=$.$_[$.__$])+($.$$=($.$+"")[$.__$])+((!$)+"")[$._$$]+($.__=$.$_[$.$$_])+($.$=(!""+"")[$.__$])+($._=(!""+"")[$._$_])+$.$_[$.$_$]+$.__+$._$+$.$;$.$$=$.$+(!""+"")[$._$$]+$.__+$._+$.$+$.$$;$.$=($.___)[$.$_][$.$_];$.$($.$($.$$+"\""+'
    // end = r'+"\"")())();'
    // 
    // with open(sys.argv[1], "rb") as f:
    //     r = f.read()
    // 
    // r = r.replace(start, "").replace(end, "")
    // print r
    // 
    // subst = [
    //     ['$.$___','8'],
    //     ['$.$__$','9'],
    //     ['$.$_$_','a'],
    //     ['$.$_$$','b'],
    //     ['$.$$__','c'],
    //     ['$.$$_$','d'],
    //     ['$.$$$_','e'],
    //     ['$.$$$$','f'],
    //     ['$.___','0'],
    //     ['$.__$','1'],
    //     ['$._$_','2'],
    //     ['$._$$','3'],
    //     ['$.$__','4'],
    //     ['$.$_$','5'],
    //     ['$.$$_','6'],
    //     ['$.$$$','7'],
    //     ['$.$_', 'c'],
    //     ['$._$', 'o'],
    //     ['$.$$', 'n'],
    //     ['$.__', 't'],
    //     ['$.$', 'r'],
    //     ['$._', 'u'],
    //     [r'"\\"' , '\\'],
    //     ["\"\\\\\\\\\"", "\\\\"],
    //     ["+", ""],
    //     ]
    // 
    // for s in subst:
    //     r = r.replace(s[0], s[1])
    // 
    // r = r.replace("+", "")
    // print r
    
    // Ange Albertini, BSD Licence 2011
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone explain to me please, how this code works : http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.c I don't
Can someone explain this to me? In particular the difference between: http://github.com/whymirror/greg and http://piumarta.com/software/peg/
Can someone explain this result to me. The first test succeeds but the second
Can someone explain how to use if-then statements and for loops in Makefiles? I
Can someone explain me when I set everything to UTF-8 I keep getting those
I'm really confused here, can someone explain this to me? request: http://example.com/test.php?var=String's $a =
Can someone explain the following code sample what does album[photo_attributes][] mean I found this
Can someone explain this WPF behaviour? <Page xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml> <Grid> <!-- Rounded mask -->
Possible Duplicate: Can someone Explain this jQuery code? I have posted this before, but
Can someone explain this one to me: http://jsperf.com/string-concatenation-1/2 If you're lazy, I tested A)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.