Sunday, January 17, 2016

An algorithm Italian repairing a flaw browsers: acquist … – Reuters

An algorithm Italian repairing a flaw browsers: purchases and online games safer

It will serve to fix a bug found in the JavaScript in the creation of numbers pseudocausali, was adopted by Chrome, Firefox and Safari

An algorithm invented by an Italian mathematician will be installed on computers, tablets and smartphones worldwide. To the resolution a “bug” emerged in JavaScript, in the creation of “numbers pseudocausali,” used for online purchases and video games. The new algorithm xorshift128 + was developed by the mathematician Sebastiano Vigna University of Milan and has been adopted by major browsers, such as Chrome, Firefox and Safari.

It is installed on electronic devices allow you to fix a problem in JavaScript, the language used by all web pages to create dynamic effects at the base of the so-called Web 2.0′. The fault belongs to an important feature, the pseudorandom number generation, required for example to identify transactions in online shopping or to introduce randomness in video games (think extraction of lottery tickets or distributing the cards in online poker) .

“Generate random numbers is difficult and very expensive,” says Vigna. “Therefore since the forties have developed algorithms to calculate numbers in a deterministic way, mimicking the randomness that can be achieved only with physical processes (such as throwing a dice), but it would be too expensive to reproduce on a large scale to generate the millions of random bits per second of which is needed on the web. ”

Until last month, the sequences of pseudorandom numbers provided by the popular browsers (Chrome, Safari and Firefox) were based on an algorithm that could create serious problems found in a clear manner “when JavaScript is used for server management, “says Vigna.

The most serious flaw was discovered by a start-up that deals with online gambling. “Using JavaScript to manage the site, have shown that the algorithm extracted similar numbers more often than might be expected, threatening to identify two different bets with the same sequence of numbers.”

The problem has been completely solved by Sebastiano Vigna with the new algorithm xorshift128 +, whose code will be installed and run on the vast majority of existing terminals (phones, tablets and PCs).

 

 Did you enjoy this article?
 

 
 Subscribe to the newsletter LaStampa
 

 

AP

 16/01/2016

 

ANSA

 16/01/2016

 

AFP

 16/01/2016

 

AFP

 16/01/2016

“);
 }
 // ———————————————— -
 //
 // Move to column 2 related articles
 //
 // ———————————————— -
 if (device.mobile () & amp; & amp; urlPagina.indexOf (“newsletter”) == -1) {
 ArtCorr var j = $ (“# col1ContainerArtCorr”). detach ();
 J $ (“# ed_Related_Box”). Before (ArtCorr);
 var cont = ArtCorr.find (“. ls-box-items-related .LS-boxcontent-body .LS-boxcontent-body-view”);
 ArtCorr.find (“. Ls-boxcontent #scrollArrows”). Css (“display”, “none”);
 if (cont.find (“. ls-boxUltimoArticolo”). length & gt; 0) {
 cont.find (“. ls-boxUltimoArticolo”). each (
 function (index) {
 cont.append (j $ (this) .html ());
 J $ (this) .detach ();
 }
 );
 ArtCorr.show ();
 var base = ArtCorr.find (“. ls-box-related items”);
 base.swiper ({
 Container: base.find (“. ls-boxcontent-body”),
 content: base.find (“. ls-boxcontent-body-view”)
 });
 }
 
 ExpertCorr var j = $ (“# col1ContainerExpertCorr”). detach ();
 J $ (“# ed_Related_Box”). Before (ExpertCorr);
 var cont = ExpertCorr.find (“. ls-box-items-related .LS-boxcontent-body .LS-boxcontent-body-view”);
 ExpertCorr.find (“. Ls-boxcontent #scrollArrows”). Css (“display”, “none”);
 if (cont.find (“. ls-boxUltimoArticolo”). length & gt; 0) {
 cont.find (“. ls-boxUltimoArticolo”). each (
 function (index) {
 cont.append (j $ (this) .html ());
 J $ (this) .detach ();
 }
 );
 ExpertCorr.show ();
 var base = ExpertCorr.find (“. ls-box-related items”);
 base.swiper ({
 Container: base.find (“. ls-boxcontent-body”),
 content: base.find (“. ls-boxcontent-body-view”)
 });
 }
 }
 else {
 if ($ j (“# col1ContainerArtCorr .LS-boxUltimoArticolo”). size () & gt; 0) {
 J $ (“# frame1PlaceHolder”). After (“

” + j $ (“# col1ContainerArtCorr”). Html () + “

“); } Else if ($ j (“# col1ContainerExpertCorr .LS-boxUltimoArticolo”). Size () & gt; 0) {$ j (“# frame1PlaceHolder”). After (“

” + j $ (“# col1ContainerExpertCorr”) .html () + “

“); }} // ———————————————- —- // // Hide the box if there are no related articles and multimedia // // ————————— ———————– if (j $ (“# containerMMCorr .LS-boxUltimoArticolo”). size () == 0) {$ j (” #containerMMCorr “). css (” display “,” none “); } If ($ j (“# containerArtCorr .LS-boxUltimoArticolo”). Size () == 0) {$ j (“# containerArtCorr”). Css (“display”, “none”); } If ($ j (“# containerExpertCorr .LS-boxUltimoArticolo”). Size () == 0) {$ j (“# containerExpertCorr”). Css (“display”, “none”); } // ———————————————– — // // Management box recent articles in opening // // ——————————– —————— $ j (“. ls-new-leaf-.LS boxUltimiArticoli-top-.LS boxcontent-body”). height (60); boxManual = true; boxOpened = false; var topBannerHeight; var topUltimiArticoliHeight; var topTotalTopHeight; // // ———————————————- —- // // // // Display Expert System ———————————- —————- if ($ j (“. ls-articoloTesto”). height () & gt; 550) j {$ (“. ls-articoloImmagini-Spacer”). css (“height”, $ j (“. ls-image-article”). height () + 120); $ J (“. Ls-image-article”). Css (“display”, “inline”); } If ($ j (‘. Ls-articoloES-Links’). Height () == 0) {$ j (‘. Ls-articoloES-Links’). Css (‘display’, ‘none’); } // ———————————————– — // // // // Initialization loading page ———————————— ————– $ j (document) .ready (function () {// Articles premium in the box Expert System should not have the title blue j $ (“# containerExpertCorr .LS .LS-box-title-scream-titoloLink “). removeClass (” title_premium_true “); // Adaptation of video for mobile if (device.mobile ()) {$ j (‘. ls-articoloScript iframe’). width (j $ (window) .width ()); $ j (‘. ls-articoloScript iframe’). height (j $ (window) .width () * 9/16);} // // Initialize the top by removing 4px of padding-top box to align the thread blue top topbannerSectionHeight // var j = $ (‘. ls-topBannerSection’). outerHeight (true) – 4; // // Initialization of the arrows Latest Articles // $ j (‘.arrow_up_big’). css (“display”, “none”); $ j (‘. arrow_down_big’). css (“display”, “block”); // // Initialization edges Latest Articles // var rightBoxUltimiArticoli j = $ (‘# containerLista #boxUltimoArticolo’). last (); rightBoxUltimiArticoli.addClass (‘BorderRight’); // // // Initialization related articles maxAltezzaBox var = 730; hContainerArt var j = $ (“# containerArtCorr .LS-boxcontent-body-view”). height (); hViewArt var j = $ (“# containerArtCorr .LS-boxcontent .LS-box-items-related .LS-boxcontent-body”) .height (); var height = Math.min (hContainerArt, hViewArt); height = Math.min (height, maxAltezzaBox); J $ (‘# containerArtCorr .LS-boxcontent .LS-box-items-related .LS-boxcontent-body’). Height (height); J $ (“# containerArtCorr #articoliCorrScrollUp”). Attr (‘src’, ‘/ common / img / arrow_up_disabled.png’); J $ (“# containerArtCorr #articoliCorrScrollUp”). RemoveClass (‘. Active’); // // I hide the arrows to scroll if there are fewer than three articles // if ($ j (“# containerArtCorr .LS-boxUltimoArticolo”). Size () 60) {$ j (node) .text (titolo.substring (0, 60) + ‘…’); }}); // // Add the div for the management of the scroll // j $ (‘. Ls-topBannerSection’). After (”); J $ (‘# afterTopBanner’). Height (topBannerHeight); J $ (‘# getFixed’). After (”); J $ (‘# afterUltimiArticoli’). Height (topTotalTopHeight); afterUltimiArticoliTop var j = $ (‘# afterUltimiArticoli’). position (). top; // // Management box in column 2 // var height = (j $ (‘. Ls-articoloTesto’). Height () + j $ (‘. Ls-articoloTesto’). Position (). Top) – $ j (‘# containerMMCorr’). height () – j $ (‘# containerArtCorr’). height () – $ j (‘. ls-column2′). offset (). top; J $ (‘# containerMMCorr’). After (”);
 
 //
 
 
 J $ (window) .scroll (function (event) {
 
 var y = j $ (this) .scrollTop ();
 
 if (($ j (window) .scrollTop () & gt; $ j (‘. ls-articoloTesto’). height ()) & amp; & amp; ($ j (window) .scrollTop () & gt; 800)) {
 if ($ j (“# sh_socialized_bottom”). css (‘display’) == ‘none’) {
 J $ (“# sh_socialized_bottom”). Css (‘display’, ‘block’);
 $ J (“# sh_socialized_bottom”). Html ($ j (“# sh_socialized”). Html ());
 }
 } Else {
 J $ (“# sh_socialized_bottom”). Css (‘display’, ‘none’);
 J $ (“# sh_socialized_bottom”). Html (”);
 }
 
 if (device.tablet () || device.mobile ()) {
 return;
 }
 
 //
 // Management of the top header
 //
 if (y & gt; 0) {
 if (j $ (window) .scrollTop () & gt; j = $ (‘# page_header’). offset (). top) {
 //
 // Top header fixed
 //
 
 if (if! = 1) {
 If = 1;
 
 $ J (‘. Ls-topBannerSection’). AddClass (‘fixed’);
 $ J (‘. Ls-topBannerSection’). AddClass (‘fixedTopHeader’);
 
 J $ (‘# afterTopBanner’). Css (‘display’, ‘block’);
 
 topBannerHeight j = $ (‘. ls-topBannerSection’). height () + j $ (‘. ls-boxUltimiArticoliLista’). height ();
 
 // Console.log (‘Case:’ + event);
 }
 
 if (j $ (window) .scrollTop () (j $ (‘# getFixed’). offset (). top – $ j (‘. ls-topBannerSection’). height ())) {
 //
 // Management box recent articles
 //
 if (if! = 3) {
 case = 3;
 
 J $ (‘# afterUltimiArticoli’). Css (‘display’, ‘block’);
 
 J $ (‘# getFixed’). AddClass (‘fixed’);
 J $ (‘# getFixed’). AddClass (‘fixedTopArticoli’);
 
 // J $ (‘. FixedTopArticoli’). Css (‘top’, topbannerSectionHeight + ‘px’);
 // AfterUltimiArticoliTop j = $ (‘# getFixed’). Offset (). Top + j $ (‘# getFixed’). Height () – $ j (‘. Ls-topBannerSection’). Height ();
 
 // Console.log (‘Case:’ + event);
 }
 } Else {
 
 }
 
 //
 // Management of related articles in column 2
 //
 
 if (j $ (window) .scrollTop () & gt; j $ (‘. ls-articoloTesto’). height ()) {
 if ($ j (“# containerArtCorr”). css (‘top’) == ’0px’) {
 if ($ j (“# containerArtCorr”). css (‘display’) == ‘block’) {
 postop var j = $ (‘# ad_frame2′). offset (). top – $ j (‘. ls-column2′). offset (). top + 250;
 var posBottom postop = + j $ (“# containerArtCorr”). height ();
 
 if ($ j (‘# ed_Related_Box’). offset (). top & gt; posBottom) {
 J $ (“# containerArtCorr”). Css (‘display’, ‘none’);
 J $ (“# containerArtCorr”). Css (‘position’, ‘relative’);
 
 
 J $ (“# containerArtCorr”). Css (‘top’, postop + ‘px’);
 $ J (“. Ls-column2″). Height ($ j (‘. Ls-column1′). Height ());
 J $ (“# containerArtCorr”). FadeIn (600);
 }
 }
 }
 } Else {
 J $ (“# containerArtCorr”). Css (‘top’, ’0px’);
 }
 } Else {
 if (if! = 4) {
 event = 4;
 
 J $ (‘# afterTopBanner’). Css (‘display’, ‘none’);
 J $ (‘# afterUltimiArticoli’). Css (‘display’, ‘none’);
 
 $ J (‘. Ls-colonneArticolo’). Css (‘position’, ‘static’);
 $ J (‘. Ls-colonneArticolo’). Css (‘top’, ’0px’);
 
 $ J (‘. Ls-topBannerSection’). RemoveClass (‘fixed’);
 $ J (‘. Ls-topBannerSection’). RemoveClass (‘fixedTopHeader’);
 
 $ J (‘. Ls-spinster’). Css (‘position’, ‘static’);
 $ J (‘. Ls-spinster’). Css (‘top’, ’0px’);
 
 J $ (‘# getFixed’). RemoveClass (‘fixed’);
 J $ (‘# getFixed’). RemoveClass (‘fixedTopArticoli’);
 
 // Console.log (‘Case:’ + event);
 }
 }
 });
 });
 
 // ———————————————— -
 //
 // Management of the box past articles in opening
 //
 // ———————————————— -
 
 // Store the open / close status of the box to avoid
 // Handle the same event in the scroll
 boxOpened var = false;
 
 // Store if the box was New hotel opened or closed
 // Manually to not change the state
 // In automatic mode during the scroll
 boxManual var = false;
 
 $ J (‘. Arrow_down_big’). Click (function () {
 // I open the box
 boxManual = true;
 ultimiArticoliBox (‘open’);
 });
 
 $ J (‘. Arrow_up_big’). Click (function () {
 // I close the box
 boxManual = true;
 ultimiArticoliBox (‘close’);
 });
 
 ultimiArticoliBox function (action) {
 var speed1 = 300;
 speed2 var = 500;
 
 if ((action == ‘open’) & amp; & amp; (boxOpened == false)) {
 var cssProp;
 
 $ J (‘. Arrow_up_big’). Css (“display”, “block”);
 $ J (‘. Arrow_down_big’). Css (“display”, “none”);
 
 cssProp = {height: ’180px’};
 $ J (“. Ls-new-leaf-.LS boxUltimiArticoli-top-.LS boxcontent-body”). Animate (cssProp, speed2);
 
 cssProp = {top: ’20px’};
 // J $ (‘# getFixed #boxUltimoArticolo .LS-boxUltimoArticolo-info’). Animate (cssProp, speed2);
 J $ (‘# getFixed #boxUltimoArticolo .LS-box-text’). Animate (cssProp, speed2);
 
 
 cssProp = {top: ’0px’};
 // J $ (‘# getFixed #boxUltimoArticolo .imgUltimoArticolo’). Animate (cssProp, speed2);
 J $ (‘# getFixed #boxUltimoArticolo .LS-box-image’). Animate (cssProp, speed2);
 
 cssProp = {height: ’179px’};
 $ J (“. Ls-new-leaf-.LS boxUltimiArticoli-top-.LS boxUltimiArticoliLista”). Animate (cssProp, speed2,
 function ()
 {
 var height = j $ (‘# getFixed’). height ()
 cssProp = {height: + height + ‘px’};
 J $ (‘# afterUltimiArticoli’). Animate (cssProp, speed1);
 }
 );
 
 boxOpened = true;
 }
 if ((action == ‘close’) & amp; & amp; (boxOpened == true)) {
 var cssProp;
 
 $ J (‘. Arrow_up_big’). Css (“display”, “none”);
 $ J (‘. Arrow_down_big’). Css (“display”, “block”);
 
 cssProp = {top: ‘-130px’};
 // J $ (‘# getFixed #boxUltimoArticolo .imgUltimoArticolo’). Css (‘position’, ‘relative’);
 // J $ (‘# getFixed #boxUltimoArticolo .imgUltimoArticolo’). Animate (cssProp, speed2);
 
 J $ (‘# getFixed #boxUltimoArticolo .LS-box-image’). Css (‘position’, ‘relative’);
 J $ (‘# getFixed #boxUltimoArticolo .LS-box-image’). Animate (cssProp, speed2);
 
 
 cssProp = {top: ‘-100px’};
 // J $ (‘# getFixed #boxUltimoArticolo .LS-boxUltimoArticolo-info’). Css (‘position’, ‘relative’);
 // J $ (‘# getFixed #boxUltimoArticolo .LS-boxUltimoArticolo-info’). Animate (cssProp, speed2);
 
 J $ (‘# getFixed #boxUltimoArticolo .LS-box-text’). Css (‘position’, ‘relative’);
 J $ (‘# getFixed #boxUltimoArticolo .LS-box-text’). Animate (cssProp, speed2);
 
 cssProp = {height: ’59px’};
 $ J (“. Ls-new-leaf-.LS boxUltimiArticoli-top-.LS boxUltimiArticoliLista”). Animate (cssProp, speed2);
 
 cssProp = {height: ’60px’};
 $ J (“. Ls-new-leaf-.LS boxUltimiArticoli-top-.LS boxcontent-body”). Animate (cssProp, speed2,
 function ()
 {
 var height = j $ (‘# getFixed’). height ()
 cssProp = {height: + height + ‘px’};
 J $ (‘# afterUltimiArticoli’). Animate (cssProp, speed1);
 }
 );
 
 J $ (‘# afterUltimiArticoli’). Height (j $ (‘# getFixed’). Height ());
 
 boxOpened = false;
 }
 }
 
 
 // ———————————————— -
 //
 // Management related articles
 //
 // ———————————————— -
 
 var speed = 300;
 var valueArt = 0;
 var topValueArt = 0;
 var minValueArt = 0;
 numArticoli var j = $ (“# containerArtCorr .LS-boxcontent-body-view .LS-boxUltimoArticolo”). length;
 currArticolo var = 1;
 
 // ———————————————— -
 // Click Arrow pointing down
 //
 // ———————————————— -
 J $ (“# containerArtCorr #articoliCorrScrollDown”). Click (function () {
 
 valueArt = valueArt – $ j (j $ (“# containerArtCorr .LS-boxUltimoArticolo”). get (currArticolo – 1)). outerHeight ();
 cssProp var = {top: + valueArt + ‘px’};
 
 if ($ j (“# containerArtCorr #articoliCorrScrollDown”). hasClass (‘. active’) == false)
 return;
 
 currArticolo ++;
 
 J $ (“# containerArtCorr .LS-boxcontent .LS-box-items-related .LS-boxcontent-body .LS-boxcontent-body-view”). Animate (cssProp, speed,
 function () {
 J $ (“# containerArtCorr #articoliCorrScrollUp”). Attr (‘src’, ‘/ form / new-leaf / img / arrow_up.png’);
 J $ (“# containerArtCorr #articoliCorrScrollUp”). AddClass (‘. Active’);
 
 heightContainer var j = $ (“# containerArtCorr .LS-boxcontent .LS-box-items-related .LS-boxcontent-body .LS-boxcontent-body-view”). height ();
 if (currArticolo & gt; (numArticoli – 1)) {
 J $ (“# containerArtCorr #articoliCorrScrollDown”). Attr (‘src’, ‘/ common / img / arrow_down_disabled.png’);
 J $ (“# containerArtCorr #articoliCorrScrollDown”). RemoveClass (‘. Active’);
 } Else {
 J $ (“# containerArtCorr #articoliCorrScrollDown”). Attr (‘src’, ‘/ common / img / arrow_down.png’);
 J $ (“# containerArtCorr #articoliCorrScrollDown”). AddClass (‘. Active’);
 }
 }
 );
 
 });
 
 // ———————————————— -
 // Arrow upwards Click
 //
 // ———————————————— -
 J $ (“# containerArtCorr #articoliCorrScrollUp”). Click (function () {
 
 valueArt = valueArt + $ j (j $ (“# containerArtCorr .LS-boxUltimoArticolo”). get (currArticolo – 2)). outerHeight ();
 
 cssProp var = {top: + valueArt + ‘px’};
 
 if ($ j (“# containerArtCorr #articoliCorrScrollUp”). hasClass (‘. active’) == false)
 return;
 
 currArticolo–;
 
 J $ (“# containerArtCorr .LS-boxcontent .LS-box-items-related .LS-boxcontent-body .LS-boxcontent-body-view”). Animate (cssProp, speed,
 function () {
 J $ (“# containerArtCorr #articoliCorrScrollDown”). Attr (‘src’, ‘/ form / new-leaf / img / arrow_down.png’);
 J $ (“# containerArtCorr #articoliCorrScrollDown”). AddClass (‘. Active’);
 
 if (numArticoli

LikeTweet

No comments:

Post a Comment