Human generated semi-random binary stream
zeroone.io
zeroone.io
3Vÿÿª§ò
·wudÕLÜØE(@Àï¦ìµQ$"`$´´$¤ª @az«hÀ@( @ @ ¢KBB@ /
…isn't an "ascii stream". You can look at the source code for "covertBinaryToAscii", and it's really converting 8 bits of random data at a time into one of the first 256 Unicode code points.(Also, you can avoid the need to escape special characters by using textContent[1] over innerHTML, although that comes with the catch of only being supported in IE 9 and later…)
[1]: https://developer.mozilla.org/en-US/docs/Web/API/Node/textCo...
https://en.wikipedia.org/wiki/Extended_ASCII
Weirdly, because neither chart has the smiley face characters I don't find them trustworthy charts. I am obviously wrong!
It was originally vulnerable to Javascript injection (with potential for XSS), since the "ascii stream" had no protection against arbitrary HTML that could be injected by binary-encoding it and sending it using a little script. I only had the time to PoC by injecting goat pictures: the next day, I tried making a more fleshed out potential-XSS demonstration and the author fixed the vulnerability while I was playing with it.
There's still a (disputable) glitch that I'd like to point out: the ASCII stream is different for everyone, since it's rendered client-side and simply uses the first available bit on page load as point of reference to know when a byte starts.
This "frameshift" glitch obviously marred my injection demonstration, but it's still somewhat annoying for anyone who wants to demo their l33t skills, as other viewers only have 1/8 chance of seeing any binary-encoded text that we send. So currently, the ugly way of forcing a message to be seen is by sending it 7 times, once for every possible alignment. (But why would anyone do that, right?)
Edit: It also looks like nothing is working anymore today.
There are lots of tiny bugs on this experiment. I actually started it as the regular node js chat tutorial, and figured out it would be fun to create a femto-blogging platform as you might see in the about page.
I'm still working on fixing bugs and improve rate limiting.
<troll>
in b4 someone writes a JS app that uses this to generate crypto keys
</troll>I then argued with him about the money he would likely lose implementing his plan. He said, "what are the odds the ball will land on red five times in a row?". (We were ignoring the existence of the green 0 and 00). I took out a quarter, flipped it seven times, and it landed heads every time. This happened straight-away.
That was a random sequence, it was all 0s, and I'd like to think he was lucky that it happened that way, and convinced him to abandon his plan.
But I was also lucky. I had intended to demonstrate this, and was prepared to be flipping the coin hundreds of times until the run of 0s came up. You could say I was predicting the next result correctly 100% of the time on those first 7 flips. But my ability to predict the results didn't show their non-randomness, instead it showed my "luckiness". Which really means they weren't predictions at all, I guess.
To generate a highly random output that appears independent from the source and uniformly distributed a randomness extractor [1] has to beapplied. The most well know is the Von Neumann extractor.
IMHO random string = string that has Kolmogorov complexity = length of this string.
Almost all strings we got from random variables with uniform distribution are random, but not all.
it would work a lot better if the server made a pseudorandom bit that it sent to the user for the user to xor their choice by on client-side, and then out of spite undid that bit in half the cases on server-side.
edit: screenshot - http://imgur.com/TLUN8AT
What about if they were sending a random string themselves?
What if they were sending a script that analyzed the last so many entries and tried to provide the opposite, to have some particular desired ratio?
I wonder, given latency and other network features, could this ever achieve true randomness, despite being generated from actors with an agenda?
28kB around 9:30PM MT.
Guaranteed randomness! /s
var b = io.connect();
setInterval(function() {"00001001".split('').forEach(function(n) { b.emit('input',n); });},10)
I found it interesting to see how hard I had to hit the server to a.) get all my requests in before another person's request gets in the middle - and b.) have my 8 bits (or however many I was sending, didn't have much luck past 40 bits) occur at the start of on ascii character - as opposed to having it be off by n bits that previously were on the stack.Thankfully websockets/socket.io ensures ordering so I didn't have to worry about them becoming unordered like I would if it was using basic http requests.
ヽ༼ຈل͜ຈ༽ノ
for (i = 0; i < 100000; i++) {
b.click();
}* switch to Redis instead of MySQL
* keyboard input
* better rate limiting
* stats: 0/1 proportions
* stats: geolocalized data
* stats: hourly distribution (heatmap)
* entropy calculation
* API to get json data of latest n bits
* bits -> grey scale image generated in realtime ...