Saturday, May 18, 2013

Filter bubbles endangering Internet freedoms

The "filter bubble" is a kind of media bias ; resulting from over-personnalization, it tends to feed you only with "confortable" informations, isolating you inside your own bubble of filtered informations from the wide variety of opinions of the world.

In random graphs theory there is an interesting phenomenon called percolation. It basically says that when you have a very large random graph, depending on the average of the local structure (i.e. how many links each node have), you can determine some properties with respect to the general connectivity of the graph, and the number of hops you need to get from one node to the next. High percolation value means few hops are needed to navigate between to different ideas.
What the mathematical theory says is that depending on the local structure, there is a strong threshold effect where if you had just a little more local connectivity, you would need exponentially less hops to reach any other node in average.

"Filter bubbles" are appearing because by a clever choice of (search engine) personnalization policies we are now losing the high percolation value.

It results from the algorithms used inside search engines, which analyses your online behavior, and decides to push you the information, you will most likely enjoy. Infomation is now personalized so much that when you search for something, you will probably only find something that shares your point of view with regard to the subject you searched, which will tend to confort you on your own perspective, but at the same time, you are less and less confronted with opposite perspectives. 



This bias is particulary hard to avoid, and is self reinforcing, because of economic interest of various actors. I think it's becoming increasingly overwhelming these days mainly because of another bias of search engines, which is ultra-specialization. Most search-engine-visible websites, are now ultra specific to your query. This mean that when you have visited one page of the website you will most likely go back to the search engine, rather than following a link on the website to an unrelated surprisingly interessant subject.

It is getting harder and harder to escape from filter bubbles.

How to avoid them : As a user the cleanest way to avoid getting trapped in a filter bubble is to have control on the filter. Unfortunately, that's not something search-engines offer for now.
As a user, being aware of them and searching for a wide variety of point of views is a good step. You can also start following some website that spreads ideas on various unrelated subjects. Would the percolation number be higher would I recommend to follow links rather than using search engines.
Social medias, are not an answer to this phenomenon, as friends and communities typically show a strong cluster-like behaviour.
As a blogger, if you feel the courage (massive de-ranking is previsible), you can contribute by diversifying your blog so you could expose to a wider variety of subjects.

Friday, May 17, 2013

Quantum computing : the end of Moore's law ?

This week, independent tests have been passed by DWaveSys. A company, that has been working on quantum computing for a few years now. It was the source of some controversy in the past, but it seems that the doubts were not founded. 

The principle they use is quantum annealing. It's the property of matter to rest in the state of lowest energy when put near 0 degree Kelvin. Using some digital analog converters, they can define some energy landscapes corresponding to the problem they wish to solve, then cool the computer, then read the states of the qubits.

The results are in. When running full-hardware (i.e. best case) it's 3600 times faster than a software version at solving the particular minimisation problem (a version of the Ising problem (which is NP-Complete so it holds the promise of solving all NP-hard problems in polynomial time ) ). But what's important is not that it's more than 3 orders of magnitude faster, it's that up to now the scaling is exponential (more exactly it scales in exp( sqrt( number of qubits) ). This means that when the number of qubits will be 4 times greater, the chip will be 10 000 000 times faster than software. If the trend continues as it seems it would, moore's law will no longer hold, but contrary to what pessimistic minds could have thought, it would no longer hold because the scaling would now be doubly exponential.

Singularity, may just be a few years away...

Wednesday, May 8, 2013

Physic cooking tips

Barbecue times are coming. It reminds me of the observations I made a few times when seeing different people cooking raw cow steaks using frying pans. Basically it can be summed up as : "most people have no ideas of the physics of cooking" . They have no clue regarding how to control the fire. They have no clue regarding the flipping of the steak. And what's even more frightening, is that often this results in risks for your health. So let me show you how to improve.

Why are we cooking things ? The first reason is a sanatory one. Cooking kills bacterias. To kill bacterias by cooking, you need to have the temperature inside the bacteria maintained over a temperature for a certain time. Sterilisation time-temperature charts varies with bacterias, but you can consider that  if the raw meat cell is cooked, bacterias are dead. For cow steaks, dangerous bacterias are only on surface of the raw steak. This mean that if your steak is raw you can cook only the sides, but if your steak is grounded, you need to cook the inside (because bacteria that were on the sides are now everywhere). Depending on the type of meat you are cooking you may or may not cook only the surface. For exemple chicken, pork and most fishes should be cooked to the heart. The second reason for cooking is to ease digestion. Cooking chemichal reactions are somehow similar to reactions that will occur in your stomach. Stomachs used only to cooked food, may need some time to adapt to rawer food.

Now that we know  how it can be cooked, we need to know how to cook it the right way. Cooking is all about controling the "temperature over time" inside the meat. So you need to understand the heat diffusion inside the meat. The rule is that heat transferts are slow, and the speed of heat transfert depend on the local difference (gradient) of temperature. This mean for example that if the temperature on the side is very high, the heat will not have time to propagate inside the meat, and only the exterior will be cooked very rapidly. If the temperature on the side is lower, then heat will have time to be diffused inside the meat, and the meat will be cooked to the heart. The thickier the steak, the more time it takes to heat the heart. Flipping a steak, allow to bring quickly down the temperature of a side.

Now we need to know how to precisely set the temperature of one side. This is usually done using grease. This provide an accurate mean of setting the temperature, because we have a nice physic property which states that at a given pressure, vaporisation occurs at a constant temperature. (Around 200 Celsius depending on the oil). This mean that if you use some grease, as long as the grease is bubbling, the temperature is precisely known. No matter how strong the grease is bubbling, it will be at the same temperature, but if it bubbles strongly, the grease will evaporate and disappear more quickly while forming lots of fumes. Once the thin layer of grease between the pan and the steak has evaporated, temperatures will skyrocket and your steak will get carbonised on the outsides, grease fumes might get carbonated which is cancerigenic. So the way to regulate the fire is to set it as low as possible while preserving a bubbling greese, ideally when the fire is perfect, only the greese below and near the steak should bubble, and fumes should be quasi inexistent.
When flipping a steak be sure to maintain a thin layer of greese between the steak and the pan.

Now the last thing you need to know is that "cooking" is in fact modifying the internal structure of the meat. "Cooking" are chemical reactions that occur inside the meat. There are plenty of various reactions, but each of these reactions occurs at different speed, speed of which depends both on the reaction, and the temperature. By controlling the temperature precisely inside the meat, you can favor certain chemical reactions, and limit negative ones (like carbonization). 
An other factor that you can modify is the inner pH by cooking with some acids.

Hopefully, you now have a physically correct model, of the cooking process, which will allow you if you use a chronometer (up to seconds (once cooked remove from the pan to slow down the cooking process) ), to cook consistently. This model will help you understand what you are doing, which will make more easy to cook safely according to your tastes. 

A corrolary of this model you can use to cook salmon steak with a frying pan :  put a thin layer of water, make it boil, put the fish in the frying pan, skin side down, cover the frying pan to keep the vapor inside. As long as there is liquid water in the pan, the steam will stay 100 Celsius. Cook to the heart, find the time needed depending on the thickness. Because we only heat with less than 100 Celsius, the inside won't go higher than 100 Celsius, therefore the fish will retain its water and savor.



Saturday, January 12, 2013

Having fun with the java zero day vulnerability

One more time, there is a java zero day in the wild. There are not yet any fix except for disabling java plugin.

This vulnerability is a great introduction to computer security, for three reasons : First it is high level and very simple to use. Second, it's very effective, and lot of people are affected (Every one using java 1.7.xxx 100% of time, mac, windows, linux, any browser (even so some browser require the user to click "execute this applet" )). Third, it's not yet patched :-)

What you need to realise the attack : 
Have your target visit a webpage that displays a custom made java applet, this java applet will have full access, that's it, game almost over... (For it to be really game over : add privilege escalation then rootkit to the list)

How do you create the custom made java applet :

You copy paste from the code source avalaible on

(or https://gist.github.com/4506143 for line by line explanation)
in a file yourfilename.java (name of the file should match class name)
Fix the (intended) small mistakes ( add line 24 :

public class yourfilename extends Applet {

and fix the missing " in place of " in ByteArrayWithSecOff )

Compile with javac from a 1.7.010 JDK. You obtain a yourfilename.class that you should put somewhere on the web.
In the webpage source your target will see add 

<applet code="pathtoyourfilename.class" width="300" height ="300">

You can now test it. The victim should see a calculator opening when executing the applet.
(If you test it locally, you need a webserver to serve the html page in http(s) so that in the address bar there is 'localhost'  (instead of file:/// ) )
Depending on browser settings, it may not require any user interaction.


If you want to modify it, you just have to substitute 
Runtime.getRuntime().exec("calc.exe"); //Adapt on linux or mac
By any java code you want. 

Of course if you don't want to enter in so much details, you could just use metasploit (where there is more documentation).

Variating the source while keeping its spirit combined by serving from infected clients should allow to circumvent many antivirus. 
This vulnerability is itself a variant of a vulnerability from august 2012.

R.I.P Aaron Swartz