diff --git a/plugin/multiplex/index.js b/plugin/multiplex/index.js
index 8195f046d954ef0d3ae7d1f9be1c48dd7445a910..f11639b62ec3a3534f4a78aadc28dd19db7f65e7 100644
--- a/plugin/multiplex/index.js
+++ b/plugin/multiplex/index.js
@@ -44,7 +44,8 @@ app.get("/", function(req, res) {
 
 app.get("/token", function(req,res) {
 	var ts = new Date().getTime();
-	var rand = Math.floor(Math.random()*9999999);
+	var rand = new Uint32Array(1);
+	window.crypto.getRandomValues(rand)
 	var secret = ts.toString() + rand.toString();
 	res.send({secret: secret, socketId: createHash(secret)});
 });
@@ -61,4 +62,4 @@ var brown = '\033[33m',
 	green = '\033[32m',
 	reset = '\033[0m';
 
-console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset );
\ No newline at end of file
+console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset );