mrsec Posted July 5, 2015 Report Share Posted July 5, 2015 PHP, lotto/lucky draw newbie script - Pastebin.comAm inceput sa invat php, am nevoie de putin feedback pentru eventualele greseli de programare/gandire. Quote Link to comment Share on other sites More sharing options...
andrei98M Posted July 5, 2015 Report Share Posted July 5, 2015 Foarte simplut, e un inceput... Quote Link to comment Share on other sites More sharing options...
1337 Posted July 5, 2015 Report Share Posted July 5, 2015 Din cate stiu random-ul din PHP nu e chiar random 100%.Numerele random sunt un subiect sensibil, ai putea sa folosesti random-ul celor de la random.org pentru ca sustin ca numere lor chiar sunt random. Quote Link to comment Share on other sites More sharing options...
Active Members dancezar Posted July 5, 2015 Active Members Report Share Posted July 5, 2015 mt_rand(); in loc de rand.Am vazut undeva un tip care a generat o poza cu pixeli numere random , si se observa un flux care ar putea prezice ce numar ar fi peste un anumit numar de executii . Dar in real-case e destul de complicat de ghicit pentru ca intervin mai multi factori pid-u de exemplu care il poti afla decat din interior si ce rost mai are sa il afli daca esti in interior:)). Pe php.net spune ca functiile rand si mt_rand is functii care nu ofera siguranta criptografica si ca referinta ne da PHP: openssl_random_pseudo_bytes - Manual care cica ar fi sigur criptografic... Quote Link to comment Share on other sites More sharing options...
mrsec Posted July 6, 2015 Author Report Share Posted July 6, 2015 Pare ok insa nu am observat unde verifici unicitatea numerelor extrase.Invat din mers, si adaug pas cu pas.Am schimbat unele lucruri... PHP, lotto/lucky draw - Pastebin.com Quote Link to comment Share on other sites More sharing options...
SimpluAlaSmecher Posted July 6, 2015 Report Share Posted July 6, 2015 Pune pe github, nu pe pastebin. Quote Link to comment Share on other sites More sharing options...
malsploit Posted July 6, 2015 Report Share Posted July 6, 2015 mt_rand(); in loc de rand.Am vazut undeva un tip care a generat o poza cu pixeli numere random , si se observa un flux care ar putea prezice ce numar ar fi peste un anumit numar de executii . Dar in real-case e destul de complicat de ghicit pentru ca intervin mai multi factori pid-u de exemplu care il poti afla decat din interior si ce rost mai are sa il afli daca esti in interior:)). Pe php.net spune ca functiile rand si mt_rand is functii care nu ofera siguranta criptografica si ca referinta ne da PHP: openssl_random_pseudo_bytes - Manual care cica ar fi sigur criptografic... Quote Link to comment Share on other sites More sharing options...