Jaak Henno, TalTech, Estonia
Hannu Jaakkola, Tampere University of Technology, Pori
Jukka Mäkelä, University of Lapland, Rovaniemi, Finland
But our data is exposed in numerous breaches ...
Something for everyone ...
The main method of defence is encryption
For encryption are needed Sequences of Random Numbers
Randomness is vital for computer security - in order to generate cryptographic keys are needed random numbers
The research company Gartner predicts that by 2019 already 80 percent of web traffic will be encrypted
The e-mail encryption market is expected to have 24% annual growth through 2020
Kolmogorov: a sequence is random if it can't be compressed
Randomness tests for real sources use a series of simple fixed tests, e.g the Diehard suite contains (at least) 13 tests: Birthday spacings, Overlapping permutations, Ranks of matrices, Monkey tests, Count the 1/0 -s, Parking lot test, Minimum distance test, Random spheres test, The squeeze test, Overlapping sums test, Runs test, The craps test (a game).
but "... tests fail even with 10M inputs generated by Dieharder's own generator..." and nobody can quarantee, that this set of tests is sufficient ...
All Operating systems (OS) collect randomness.
In Linux it is stored in two files: dev/random, dev/urandom
Linux is the main OS which is used in network servers and its creators (Thorvalds) are very concerned about quality of randomness used.
However, visual assessment of the forst 7 KB of the file dev/random (Ubuntu 16.4) revealed a strange irregularity:
The starge peak in centre is the code for € ...
The famous Shannon's formula does not consider order/placement...
When playing games and competing, trying to win, humans behave non-predictably, create random moves.
Non-predictability, randomness is the main source of game enjoyment; without randomness we would not play (this is not a game !) - but we are playing more and more...
- and this randomness could be collected and used for generating encryption keys .
In a (multiplayer/any) game (also in economy) players perform actions trying to get an advantage, to win
GAME resolves these actions and gives players rewards (the utility/payoff fuction)
Game is a finite-state machine, which to player's inputs decides their payoff's
Every player has a finite number of available actions
Game has a finite number of possible payoffs
The source of payoffs is limited - when one player gets more (wins), another gets less (looses)
play is a competition with hidden/random payoffs !
When playing games and competing, trying to win, humans behave non-predictably, create random moves.
Non-predictability, randomness is the main source of game enjoyment; without randomness we would not play (this is not a game !) - but we are playing more and more...
- and this randomness could be collected and used for generating encryption keys .
In multiplayer games competing players all try to behave non-predictably, i.e. randomly
If results from all player's actions are equally probable, then the best strategy for players is use totally random moves, i.e. the sequence of player's moves is a random sequence (the game is non-learnable).
There are many games, where any pattern (non-randomness) in player's moves could be used by other players and will reduce player's result, thus the best result requires total randomness of player's moves
Examples of such games are
"Odd-Even"
Rock-Paper-Scissors
Rock-paper-scissors - m-ary
- a generalization of the 'Rock-paper-scissors' game to m > 3
The game "Odd-Even" is a simple zero-sum quessing game: two players (call them 'Odd' and 'Even') should simultaneously select either '0' or '1'; player 'Odd' wins, if the sum of selected numbers is odd (1), player 'Even' winns, if the sum is even (0 or 2) - both events have equal probability.
There are many versions of such a game, e.g. this is a symmetric version (zero-sum) version of the game )Man vs Machine (this game is not symmetric, computer has advantage - can skip its move)
If the strategy of the player 'even' for selecting '0' or '1' is
and the strategy of the player 'odd' is
then the possibility for 'Even' to win is
The optimal strategy (the 'Nash Equilibrium') is the extremum of this function, i.e follows from equation
Solving this simple equation shows, that the best strategy for player 'Even' is equal probabilities of selecting '0' or '1', i.e.
From symmetry it follows that the strategy
of player 'Odd' should also be
The Nash equilibrium of the surface (game polytope):
which describes winning possibilities of the player 'even' (or 'odd') is the saddle point in the center of the play area:
..
Both players should select '0' or '1' with equal probability, but so, that the opponent could not quess their selection
Both players should be maximally random !
Players should learn the opponent's startegy!
In the game this strategy can be used for revealing opponent's (non)randomness
a random sequence can not have (long) repeated subsequences)
otherwise it can be comprssed using e.g. the Zipfel-Lem Algorithm
In the game computer stores all moves as a sequence of pairs (as pairs from left to right, first the opponent's move).
When on move, it searches this sequence backwards with its preffix for longest repeated subsequence ('is the opponent already in loop?')
- this is the main idea of the Zipfel-Lem compression algorithm
For instance, if the sequence of played moves is (the game vocabulary contains all numbers)
then the algorithm returns sequence (the longest repeating suffix)
Now computer selects move, which beats opponents earlier move in this situation: "7"
- The Zipfel-Lem algorithm can not use this subsequence for compression and has to enter a new item to it's dictionary
(tested by authors and with participants of the Game Programming course of the first author in Tallinn University of Technology)
The main idea of the algorithm is to check wether the opponent is already in loop, i.e. repeating moves
Speed of appearing loops and their length is another test for quality of randomness source
Below are results of one test - length of repeated suffix and number of such loops appearing in 10 tests in Firefox, every test with 10000 moves (JavaScript random() against computer)
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
982 | 932 | 756 | 416 | 153 | 46 | 11 | 5 | 3 | 1 | 0 |
Better player 1 | Better player 2 | ||||||||||
Firefox | Chrome | Firefox | Chrome | ||||||||
0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |
1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 2 |
2 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 |
2 | 2 | 2 | 3 | 2 | 1 | 2 | 2 | 2 | 1 | 2 | 3 |
3 | 2 | 2 | 3 | 2 | 1 | 2 | 3 | 3 | 2 | 3 | 4 |
4 | 3 | 3 | 3 | 2 | 1 | 2 | 3 | 3 | 3 | 4 | 5 |
5 | 4 | 4 | 3 | 3 | 1 | 2 | 3 | 3 | 4 | 4 | 6 |
6 | 5 | 5 | 3 | 3 | 1 | 2 | 3 | 3 | 3 | 5 | 5 |
6 | 5 | 5 | 3 | 3 | 1 | 3 | 4 | 4 | 6 | 6 | 8 |
7 | 6 | 6 | 3 | 42 | 3 | 4 | 4 | 7 | 6 | 8 |
|
The game is non-learnable, if the sums of all rows and columns are equal - the expectation of payoff for any move is the same:
In such a game the average (expected) payoff of any move is
Even the TensorFlow can not learn such games ...
The best strategy for a player is total randomness
The 'Odd-Even' (and its 3D interpretation) allow to create random binary sequences.
Generalizations of the well-known rock-paper-scissors game allow to create random sequences of m-ary integers {0,1,...,m-1} for any m > 2The randomness test program "Ent" shows, that the string produced by interactions in the 'Odd-Even' game is nearly uncompressable, i.e. good.
Players have only their own moves, e.g. player1 has sequence
When a player asks for key server sends the sequence of moves, where player's own moves are removed;
the sequence could encrypted as all game moves
or(weak one-time key for symmetric encryption) using the sequence of players moves as the key
- player inserts into this sequence his own moves - this will be the new (strong) key for the chat
All the following messages are secured/encrypted with the means used in game for sending player's moves and rewards.
Players store their moves in the order they made them.
When player enters the game (logs in) he receives together with his gameplay client also (a link to) a cryptographic library (for symmetric encryption), e.g. some member from the W3C list or (when using node.js) Node.js Crypto module (easy tutorial)
chat(playerList);
playerList
is a list of players or the word all
- player wants to start global chatplayerList
(with time limit for answer) playerList
all players who did not answer the invitation"Encryption OK"
playerList
the players, whose messages were not decipherableThis method allows to create keys for different subsets of players - for any two of them or for the whole population
The randomness needed for key is constantly generated by player's themselves, thus they can easity generate a new key e.g. sending a message:
"From now on use moves from time moments t0 to t1"
To increase randomness of the sequence of moves it could filtered, e.g. used only these moves which produced (or did not produce) a fixed result
In order to speed up the key generation multi-moves may be used, e.g. (in 'Odd-Even') both players select e.g. a 4-bit string (byte) - in this regime generation of 128-bit key sequence requires only 32 moves (and with 16 bit strings only 16)