Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2010-05-17 13:03:59

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Increasing the magnitude of any given number randomly

Hopefully this is in the right place:

Can anyone think of any way to increase a number by a lot, say at least 2^32 (not by just adding 2^32), with no estimation (so integers only), in a way that is very hard to reverse, even if you know the formula(s), but is easy to implement in a program and not computationally expensive. my main goal is to use the sum of all the values that went into the formula(s) as the output, and that value has to be very hard to decompose back into the individual values

currently, im squaring the values, moving a couple of bits around (since this is done in a program) and then adding them.


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#2 2010-05-17 15:20:40

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

Hi calccrypto;

I played with this idea, a long time ago. The method is to devise your own linear congruential  random number generator and of course your own seed value. You generate 1 random number at at a time and add it to each byte of the message. To decode the message you just start with the same seed and subtract the random numbers from each byte.

On the surface it makes a very tough nut to crack. Only you know what the generator is and what the seed is. There will be no patterns in the data at all. That should take care of the human factor in cracking it. I was unable to prove that it wouldn't succumb to some other method. My feeling was is that it is safe.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2010-05-17 15:44:18

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

hi bobbym

actually, linear congruential rngs are terrible for crypto purposes. im not sure if i can convey the difference that i see in my mind: im not really looking for a way to generate a series of random numbers. im looking for a way to mess one number at a time, so there is no link between one output and the next.


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#4 2010-05-17 15:50:03

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

That is exactly what I did. By adding the random number to each number you mess ( as you say ) each number up one at a time. Unless they know the generator (remember it is custom) and the seed how can you get the original numbers back? Doesn't matter about the quality of the generator, there are an infinite amount of them.

so there is no link between one output and the next.

That is not possible by computer. Computers only generate pseudo random numbers. There is always a link between the numbers. You would have to use some physical process if you want true randomness ( no link between numbers ). But then how would you recover the numbers?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#5 2010-05-17 22:40:32

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

i meant that the values will not come out as f(x) = x1->f(x1)=x2..., depending on how many times the generator is used. im trying to find a standalone function. thats what i mean by 'no link'. not completely independent of each other, but not just a series of numbers generated by recursion 

come to think of it, maybe i can constantly change the values of a linear congruential rng...


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#6 2010-05-17 23:37:24

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

Hi calccrypto;

If you give me an example that we can both refer to maybe I can help a little bit more.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#7 2010-05-18 08:29:35

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

i worded myself terribly. i should have made the title something like "how to change a number in a way that is hard to recover, with randomness as a side-effect"

theres really no example. since the values could be anything, i can just as well say output value = 0xf3d (12 bits) or 0x1f0dd13 (28 bits), and the output size is 128 bits, so f(0x1f0dd13) -> some 120 bit number. however, f^-1(0x1f0dd13) is very hard/impossible to get back


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#8 2010-05-18 08:49:02

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

Thats Ok, I do it all the time.

But that is my point adding a random number starting from a given known seed makes the target number impossible to recover. Only to you would it be both fast and easy.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#9 2010-05-18 10:31:11

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

well im not trying to get back the values. i just dont want other people to be able to

so maybe i should change values in the rng every round, and seed it every round, and only use 1 output number?


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#10 2010-05-18 17:17:54

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

so maybe i should change values in the rng every round, and seed it every round, and only use 1 output number?

You can do that but why? It will take much more work. Any scheme that you come up with will probably be unrecoverable except to a handful of people. Sounds like you want to destroy data, sort of like a shredder program.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#11 2010-06-09 09:35:01

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

it sort of is like a shredder program. crypto hashes take data apart and create short, unrecoverable, (supposedly) unique outputs

sorry for replying so late. ive been pretty busy


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#12 2010-06-09 13:16:09

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

Hi cal;

You can use any random number generator that you know how to write, put a different seed in each time and blast over the data.

Shredder programs don't do that though and they are extremely secure.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#13 2010-06-10 22:25:43

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

okay. my mistake. its really a checksum, but it seems like a shredder because it takes [a copy of the] data apart and gets a value from that data


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#14 2010-06-11 02:47:07

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

Hi calccrypto;

A checksum is a algorithm mostly used for detecting errors in data. The simplest checksum were like the old TRS 80 method of verifying data from an IO stream. It consisited of keeping a running sum of each byte mod 8 and tacking the answer onto the end of the stream of bytes.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#15 2010-06-11 08:07:32

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

well the algorithm im messing around with is supposed to be a crypto hash, which are used for data integrity. its like error detection, but it really is meant for checking if someone has tampered with the data that was sent, rather than if a byte here or there got lost. they are basically the same thing, but used for [similar, but] different reasons


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#16 2010-06-11 10:58:15

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

What is the name of the algorithm?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#17 2010-06-11 11:13:50

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

its my own: hash2x 3. im trying to get the second to last outputs to be changed into something massive, so they can be shrunk down to the proper size in the last function. right now, im squaring the numbers, which is not very helpful if i need a 32 bit number but the output is 1. also, i assume that squaring+adding can be undone somehow, even if the values are added together (something like [5,3,6]-> [25,9,36]-> 70). thus, im looking for a function that increases the value of any output by a lot, is one to one, and causes some randomness

http://calccrypto.wikidot.com/hash-2x-v3


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#18 2010-06-11 11:28:32

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

Hi;

also, i assume that squaring+adding can be undone somehow, even if the values are added together (something like [5,3,6]-> [25,9,36]-> 70).

A long time ago, when I was working on hashing functions I thought that. Yes, 70 can be undone because it has a unique breakdown as a sum of 3 squares. If your sum was 114 then you cannot uniquely go backwards because 114 = 1^2 + 7^2 + 8^2 or 114 = 4^2 + 7^2 + 7^2 or 114 = 5^2 + 5^2 + 8^2.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#19 2010-06-11 11:30:19

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

ah ha! i knew it. so, what should i change the squaring+adding to?


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#20 2010-06-11 11:33:42

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

Have you ever heard of the ice cream problem?


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#21 2010-06-11 15:45:36

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

no


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#22 2010-06-11 15:54:09

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

A guard wants to dole out ice cream to a bunch of prisoners. He wants that they only get 1 serving each. he doesn't trust them so how can he know? He gives each prisoner a prime number to hold and he starts with the product of all their numbers. When the prisoner gets his ice cream he divides the prisoners prime number into the product number. Depending on what he is left with he can always tell who has had ice cream and who hasn't.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#23 2010-06-12 05:12:22

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

hm... its sort of like inverse square+adding.

so what would you recommend to do instead of squaring? i have to add the values one way or another


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

#24 2010-06-12 05:23:17

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: Increasing the magnitude of any given number randomly

That's the point, I didn't solve the problem then and now believe that it may not possible. Even the idea of using prime numbers which will produce unique hash values ( no collisions ) and are certainly recoverable.They lose this propertty when you are stuck with the restriction of finite integers. This is what what are you are doing when you modulo numbers, you are destroying information.

Example:

5 * 5 * 5 * 5 is 625. The 625 is unique in that it can only factored into 5 * 5 * 5 * 5. No other bunch of primes when multiplied will yield 625. We use that fact in the ice cream problem. If I take 625 mod 23 you get 4. 4 factors into 2 * 2. All information is gone, forever. Now the 23 is arbitrary, just to illustrate a point. Any mod will have the same effect.

Whatever operations you perform on your input, if you then mod m them, by the dirichlet drawer principle, you can't have more than m numbers before a collision is assured. Since 2 or more inputs yield the same output, information about the formation has to have been lost.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#25 2010-06-12 07:32:27

calccrypto
Member
Registered: 2010-03-06
Posts: 96

Re: Increasing the magnitude of any given number randomly

darn. i guess im stuck with it then

thanks for your help bobbym!!!


Visit calccrypto.wikidot.com for detailed descriptions of algorithms and other crypto related stuff (not much yet, so help would be appreciated).

Offline

Board footer

Powered by FluxBB