V
V
varkenilme2019-10-05 15:58:46
Algorithms
varkenilme, 2019-10-05 15:58:46

How to make a randomizer with the ability to check the chain?

Help me choose some kind of mat function that allows you to subtract the future vector using the current + secret number.
For example K = 0x5114, A = 80.
f(K,A) -> numbers in the range from 0x0 to 0x4000.
and the inverse function af(x,A) = 0x5114.
I thought from the beginning about a simple search for a point, not a line, or something like that through triangles. but as it did not work out to solve on the forehead.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2019-10-05
@varkenilme

Shuffle the bits in the order determined by the "secret". So, with a fixed number of bits, one range is uniquely displayed in the same, in a pseudo-random order, i.e. 1, 2, 3at the input will give "randomly" scattered at the output.
Such a mapping of a set is called a bijection .
For example, to mirror the order of bits, and where the secret has "1", in pairs, swap again.
For byte:

10101101  // вход: 173
10110101  // отзеркалили = 181
01010000  // секрет = 80
          // поменяли местами где "1" в секрете
11100101  // получилось 229

But it is necessary to think up something with ranges.
0 .. 0x3FFFit's 14 bits. At the entrance, apparently, you also need 14, although you can multiply.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question