Answer the question
In order to leave comments, you need to log in
Adds an extra number. How to fix?
Hello. I am making a game portal, the games are all on different servers. Curl I give commands. Everything works fine. Now I started worrying about security. the choice fell on xxtea (there was a ready-made solution in the net) I made a key encryption for xxtea.
//ключ для xxtea
$sekret = mt_rand(1,99999999999999);
//фальшыфка для get :D пускай тру хакеры помучаются пару недель :D
$sol = mt_rand (1, 9999999);
$iid = mt_rand (1, 900);
$iid = md5($sol.$iid.sha1($sekret.$iid).md5($sol.$iid));
$dan = base64_encode($iid);
$dan = md5($sol.$iid.$dan.sha1($sekret.$iid.$dan).md5($sekret.$iid.$dan));
//шифровка ключа который делает розшыфровку :D знаю что так надёжние :D :D
$pi = mt_rand (1, 5);
$delitil = mt_rand (1, 10);
$mnogitel = mt_rand (1, 15);
$dodan = mt_rand (1, 20);
$mn = mt_rand (1, 25);
$mn1 = mt_rand (1, 50);
$procent = mt_rand (1, 5);
$procent= $sekret / $procent;
$sekret = $sekret * $mn / $pi;
$pq = $sekret / $delitil;
$pw = $pq /$procent;
$output = $pw * $mnogitel ;
$otv = $output + $dodan * $mn1;
//розшыфровка ключа
$otv = $output / $mn1 - $dodan;
$sekret =$output * $procent * $delitil / $mnogitel /$mn * $pi;
$sekret = round($sekret);
Answer the question
In order to leave comments, you need to log in
use not round but floor/ceil if it doesn't matter what the number is
or (int) $var
blia, offtopic of course. but learn Russian, it's terribly unpleasant to read.
I think, having solved this question, the problem in the task will also disappear. An illiterate programmer didn't give up on anyone.
on the subject: in puff there are several functions for rounding. to more, to less, etc. use them
what is this footcloth of code supposed to do? perhaps this shit code can be wrapped after learning about the existence of public and private keys, uniqid, etc.
p.s. did not try to hurt religious feelings. nothing personal.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question