Skip to content

Accenture had a nice PRNG challenge at the DSE fair at DTU 2017. This is my solution to it.

License

Notifications You must be signed in to change notification settings

NicolaiSoeborg/Accenture-PRNG-Challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Accenture (broken) RNG Challenge

Accenture had a nice challenge at the DSE fair at DTU 2017.

The challenge

Playing cards are used as reels for the slot machine. Each slot machine reel can take 14 values (Accenture logo + the 13 normal cards). The Accenture logo maps to 1, while the ace maps to 14.

The next four random values (cards) are chosen as shown below.

equation1

equation2

Here r = [r_1, r_2, r_3, r_4] is the reel vector where r_1 is the left most reel. z_0 is just a random vector.

The * is an element-by-element multiplication and % is the modulo operator. The vector u is generated by grouping the lower 16 bit of the number provided by the user (input field below the reels), into groups of 4 bits.

Example

Let's assume the user has provided the number 12886, which in hex decimal is 0x3256; hence, the vector u is in the case given by u = [3, 2, 5, 6]^T.

Let assume z_{n-1} is [5, 3, 8, 2]^T, then z_n is defined as:

equation3

Resulting in the following reel:

equation4

Running the script

The script will create a random z (seed) and try to guess an input (u) that will produce the desired output (all cards 1).

Spin 1 (u = [0, 0, 0, 0]). Cards: [10|11|14|7]
Spin 2 (u = [9, 0, 13, 8]). Cards: [13|8|12|14]
Spin 3 (u = [2, 1, 4, 5]). Cards: [12|9|3|1]
Spin 4 (u = [13, 4, 4, 2]). Cards: [11|9|2|2]
Spin 5 (u = [5, 1, 7, 8]). Cards: [9|1|14|8]
Spin 6 (u = [9, 11, 10, 10]). Cards: [7|5|1|1]
Spin 7 (u = [8, 2, 1, 13]). Cards: [1|1|1|1]
Spin 8 (u = [11, 9, 3, 1]). Cards: [1|1|1|1]
Spin 9 (u = [0, 1, 6, 1]). Cards: [1|1|1|1]
Spin 10 (u = [9, 6, 5, 5]). Cards: [1|1|1|1]

About

Accenture had a nice PRNG challenge at the DSE fair at DTU 2017. This is my solution to it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages