algorithm - Random String generation from a given string, and inverse transform -


i working on requirement function f use string s seed , generate n no of strings y0..n , can this, want inverse ie, f-1(yi) of generated strings give me s.

y0 = f(s) # first time call f(s) gives me y0

y1 = f(s) # second time call f(s) gives me y1

...

yi = f(s) # ith time call f(s) gives me yi

and on.

the inverse function,

s = f-1(yi)

how can find functions f , f-1, other constraint character size cannot large these strings, max 20-25 characters.

any suggestions please ?

ok, channel-coding specific if in broadness, here, but:

these mathematical concepts, let's map strings numbers , @ them algebraically:

your 20-character string space, assuming we're using 128 common ascii characters, has 27 * 20 elements. that's pretty many elements.

however, communication technology has method called scrambling reversible process of mingling bits in sequence in way spreads per-bit energy on whole sequence. leads pretty randomly looking bit streams. it's typically implemented using feedback shift registers.

it's possible find 2140 state lfsr fulfills scrambling needs, , can interpret output of multiplicative scrambler next element in sequence.

however, please aware problem hard one, hope i've illustrated sufficiently -- getting has random properties harsh thing, , can't recommend implementing -- it's going make problems need rely on mathematical properties of pseudorandom string.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -