diff --git a/setup/test/tests/test.crypto.php b/setup/test/tests/test.crypto.php
index e7274118e08fcd160a1171157aaa6f6260456969..3a6db88738d37b41cf6f6e95740077b5499dba3d 100644
--- a/setup/test/tests/test.crypto.php
+++ b/setup/test/tests/test.crypto.php
@@ -88,6 +88,15 @@ class TestCrypto extends Test {
         $c->setKeys($this->master, 'simple');
         $this->_testLibrary($c, $tests);
     }
+
+    function testRandom() {
+        for ($i=1; $i<128; $i+=4) {
+            $data = Crypto::random($i);
+            $this->assertNotEqual($data, '', 'Empty random data generated');
+            $this->assert(strlen($data) == $i,
+                'Random data received was not the length requested');
+        }
+    }
 }
 return 'TestCrypto';
 ?>