Author Topic: Ensuring Cryptographic-Level Randomness  (Read 5002 times)

Is Blockland's getRandom function cryptographically secure? If not, is there any way to make it cryptographically secure?

No it's not. I don't really know about the second part, but I highly doubt it.

The only way is to implement your own randomness source.

It's most certainly not. If you're okay with getting random data from an external source you could use the RANDOM.ORG web api.

Why do you need it to be that secure?
« Last Edit: May 01, 2013, 06:50:16 PM by Ipquarx »

Why do you need it to be that secure?

BECAUSE AVATARS ARE SERIOUS BUSINESS.


i would suggest tracking mouse movements and having the user move it randomly


goddamnit, i wanted to make crypto but i dunno how to make an effective bignum library

or you know, (fast crypto) (doesn't suck cryptographically) (on torquestuff)

pick two


now go and prove me wrong - no seriously i want to see this

or you know, (fast crypto) (doesn't suck cryptographically) (on torquestuff)

pick two

Doesn't suck + on Torquestuff. I don't need it to be fast because I won't be sending large amounts of data using it; I just need it to not be RIDICULOUSLY slow.

are there really no bignum libraries?
you'd think that over the years that someone would have made one :/

are there really no bignum libraries?
you'd think that over the years that someone would have made one :/
I think there's several.

edit: Here's a few.
http://scatteredspace.com/forum/index.php?topic=2350.0 (this one looks nice)
http://www.ipquarx.com/Math.cs
http://forum.blockland.us/index.php?topic=175745.msg4549438#msg4549438
« Last Edit: May 08, 2013, 01:27:01 AM by Greek2me »

If there are any missing operations in mine, just let me know, I have the rest tucked away somewhere in my blockland folder. Note that mine is meant for integers only though.

And once again xalos, you could just use the random.org web API, you get 200,000 bits of quota every day and since you said you don't need huge amounts, that should be more than enough.
« Last Edit: May 08, 2013, 06:48:21 PM by Ipquarx »

I would suggest whoever uses those should make them "threaded" or something using schedules and breaking the work up into pieces so they don't eat your computer alive or crash blockland because it stops responding.

I would suggest whoever uses those should make them "threaded" or something using schedules and breaking the work up into pieces so they don't eat your computer alive or crash blockland because it stops responding.
This,
Recursive methods are scary with large numbers...

function lovingSecureRandom()
{
   for(%i=0;%i<getRandom(10,20);%i+=getRandom(1,3))
   {
      %r = getRandom(0,3);
      switch(%r)
      {
         case 0:
            %n += getRandom(getRandom(-10000, -1),getrandom(1,10000));
         case 1:
            %n -= getRandom(getRandom(-10000, -1),getrandom(1,10000));
         case 2:
               %n *= getRandom(getRandom(-10000, -1),getrandom(1,10000));
         case 3;
            %n /= getRandom(getRandom(-10000, -1),getrandom(1,10000));
      }
      %n = %n ** getRandom(getRandom(-10000, -1),getrandom(1,10000));
      %len = strLen(%n);
      %start = %len / 4 - getRandom(0,2);
      %end = %len - getRandom(0,4);
      %str = getSubStr(%n, %start, %end);
   }
   return %str ** getRandom(1,100000);
}tt]
Untested, but if you understand the concept of psuedo random calculations based off of psuedo random calculations with psuedo random numbers on psuedo random numbers for psuedo random number of times. There is so much random it is not possible within reason or this year or this decade to figure it out. And each time you perform a getRandom(); a new seed is planted (not literally I mean a new seed is set).
« Last Edit: May 13, 2013, 09:33:14 AM by Brian Smithers »


This will still repeat at some point and, with the same base seed, will always give the same result. Except no, because it won't work at all.
This isn't Python, ** isn't a valid operator. Secondly, TorqueScript can't handle the magnitude of numbers you're using.
5000050000 is obviously way above 999999. 234949 digits is a lot more than 6 digits.

And each time you perform a getRandom(); a new seed is planted (not literally I mean a new seed is set).

I don't see you using setRandomSeed anywhere?
« Last Edit: May 13, 2013, 10:03:11 AM by Port »