For some random reason I was making a base999 number compression function, I think it was because someone posted on sla.ckers about base 62. I wanted to see how far I could compress the numbers using a higher range of characters, then it hit me. Why not use it for js compression
You see if you convert the characters to their character code number and then extract a section of the number and convert it to a unicode character you can drastically reduce the amount of characters, provided of course your code contains enough characters as a decompression function is required.
The unpacking function simply gets the character codes, then the very specific regexp finds a range of characters from !-~ based on the character code number. This is because I only have one long number and they are not separated. I leave spaces intact because they don’t fall between the ranges and also it can break syntax if they are missing a semi-colon. It’s possible to reduce it further by including these characters.
So if you want to have some fun, try reducing the amount of characters compressed and see if you can create a smaller decompression function. Below is an example of the jspack tag in action:-
Ok as Andrea pointed out this isn’t actual compression however many systems including twitter think the unicode characters are actually only 1 byte which results in longer message. So you can compress a 280 character message into 140. Sirdarckcat manage to get it down to the 50% ratio, you can send encoded twitter messages with Hackvertor. Like this:-
The entry 'Javascript compression with unicode characters' was posted on August 15th, 2009 at 11:19 am	and last modified on August 17th, 2009 at 3:50 pm, and is filed under javascript, Security. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
man, you are confusing compression with obfuscation. If you have not an algorithm or a look up table you could even increase the size, rather than compress it. Your example:
It’s 8 bytes for the original string, 13 for the compressed one … is that compression? Is that efficient? Do not mess up concept and keep trying with your good work!
My first post on PHP non-alpha numeric code was a bit brief, in the excitement of the discovery I failed to detail in depth the process. I’ve decided to follow up with a tutorial and hopefully explain the process better for anyone wanting to learn or improve the technique.
The first part creates a variable “$_” the second part references 0 by using the prefix operator on a blank string to convert to 0, the assignment creates the array. This was a first attempt to hack together an array when I first wrote it but all sorts of tricks can be used for example you don’t need the “0” part.
I’ll leave you to experiment for ways to create arrays but you get the idea. Right we have the characters “A”, “r”, “r” and so on now we need to access them and fortunately PHP is very similar to JavaScript in that respect. The first step is to force our array into an actual string by concatenating it with a blank string like so:
The next step is to actually access a letter and PHP conveniently provides the same accessor method as JavaScript. To do that we need zero, as I showed before using the prefix operator with a blank string can convert to zero (also like JavaScript).
Now originally because I was just discovering the technique I did some crazy math operations on multiple characters to obtain other characters than Array but this wasn’t necessary as Stefan Esser pointed out you can simply increment/decrement strings. But anyway I figured the letters out by doing nested for loops of all the characters, I’ll post the script if I’ve still got it later. For now though we’ll simply increment/decrement the characters we need. I’ll show you how to get the letter “B” first.
That is the basis of how it works, we just need to construct a string that calls a function such as “chr” or generate characters manually and then an eval based function to call our code. The original post used GET but since that is already documented I’ll show you how to generate different code. We’ll use the PHP function “assert” since it evaluates code and it is allowed to be called using string references of it’s name. For example:
We therefore need to generate “assert” and our code to call. Using the template from before were we generated “Array” we simply create new references and increment the characters we need.
You will notice there are missing characters at the end “p”, “i” and “n” are alpha those are for you to generate using the techniques described. There are separate challenges to do after that for example a question to ask yourself is “How many characters are the minimum required to generate non-alphanumeric code?” another challenge is “What is the smallest amount of characters need to create a generator of non-alphanumeric code. Hope you enjoyed the write up and enjoy creating and finding new things with non-alpha php!
The entry 'PHP nonalpha tutorial' was posted on August 21st, 2012 at 5:34 pm	and last modified on August 28th, 2012 at 9:09 am, and is filed under Obfuscation, php, Security. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
Will you release a non-alpha generator that doesn’t use special characters off the back of this experiment?
Nope that is a challenge for you guys, I might get involved if it becomes a cool challenge to reduce the amount of chars used.
If only I had the time! It’d certainly be an interesting challenge. I assume it’d be harder to write a deobfuscator
Yeah de-obfuscation is always harder, I found the easiest way was to overwrite the functions that produce chars and return them instead of executing.
What other characters do you not need? What is the minimum number of characters required to produce non-alpha code?
Hey thanks man..I’m ripper ….I can’t thank you enough.. Cheers.. I didn’t expect to actually understand a lil of this shit 😀
Hey, I saw exactly that in JavaScript not long ago while I got hacked! It just wrote a document.write() which included an iframe into the DOM 😀
Astrologer Steven Forrest puts it all together in this most useable forecast report; you’ll see at a glance the major themes for you over a specified period of time, and then, if you need more detail, check it out in the section called “details.” Forrest tells you what’s happening, for how long, and why! A great gift, Sky-Log works for the astrologically savvy as well as for newcomers to the art.
Sent electronically as word documents to the email address you supply. Sky-Log is also available in print format.
Jazz melancholy, after-hours blues, world-weary dandyism. When Weinstein plays, he really goes for the soul, goes to the bottom of things, but not in a rootsy or earthy way. This is music for the type of souls who are sad when walking down a busy city street but soon bored when hiking in the woods.
After the despondent loss to City on Sunday, we are back to Premier League action. This time we take on AFC Bournemouth. The match is a usual late kick off, midweek at Old Trafford. With our title hopes more or less dead, I would still rather see us finish second than third or fourth. "Putting the pressure on" is widely laughed at and bantered but at this point, we can do no better.
Despite the loss, we have an amazing record at home and I do not expect that to change because of the City game. We still need to keep our good run going and gather momentum for the Champions League. We can use this game for as a test of character and maybe a confidence booster. Especially without Pogba, this game will not be a straightforward one. The players really need to step up and put a performance out there.
Bournemouth are one of the teams that I really like and respect, personally. Eddie Howe and his Bournemouth side are a symbol of stability and resilience. Them winning the Championship and entering the Premier League for the first time a couple of years ago, was enough for people to write them off. But they have really matched the competition and manage to avoid relegation, often upsetting a major team too. Their manager, Eddie Howe, has the perfect club for him. In the sense, I don't think he is good enough for a job at one of the top 6, at the same time, I don't think he is bad enough to manage one of the relegation candidates.
The Cherries play a 4-4-1-1 formation with Joshua King playing the number 10 role right behind either Callum Wilson or Jermaine Defoe. Given the fact that Defoe scored a brace against Palace, I think he will start against us. They have a back four that has conceded fewer goals (19) than Arsenal and Liverpool (20 each). However, the catch here is that they do not keep too many clean sheets (4). So scoring goals, unlike last season shouldn't be much of a problem once we do create them.
Where we can win the match is in midfield. Lingard needs to press their deep lying midfielder, either Lewis Cook or Harry Arter and force them to make mistakes like we did against Arsenal. Because they have conceded a lot when the defence has been left falt footed. Martial and Rashford can do a good job at punishing fullbacks for making premature runs.
Defending should not be a problem. However, they will look to make the best of set pieces and we conceded two goals against City through set pieces. We need to clear our lines before any threat can be caused by their lingering players. So that's about it for Bournemouth.
I really hope Lukaku gets back into goal-scoring form again because going into tough Champions League fixtures and a packed schedule in winter with your best striker out of form, will be a major drawback for us. In the post match blog of the derby game and multiple times on twitter, I called for Lukaku to get dropped. But I feel now that once he starts scoring, he'll get his confidence back. In midfield, Herrera needs to pull up his socks and regain last season's form. Showing excessive passion is good and that is what endears him to the fans but he needs to get the job done as well.
So that's it for the preview. Let us know what you think about the game and hit us with your predictions for the game!