We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9cf3b1e commit 64460d5Copy full SHA for 64460d5
components/security/secure_tools.rst
@@ -54,7 +54,14 @@ to work correctly. Just pass a file name to enable it::
54
55
.. note::
56
57
- If you're using the Symfony Framework, you can access a secure random
58
- instance directly from the container: its name is ``security.secure_random``.
+ If you're using the Symfony Framework, you can get a secure random number
+ generator via the ``security.secure_random`` service.
59
+
60
+.. tip::
61
62
+ The ``nextBytes()`` method returns a binary string which may contain the
63
+ ``\0`` character. If you store this value in a database or include it as
64
+ part of the URL, make sure to hash the value returned by ``nextBytes()``
65
+ (to do that, you can use a simple ``md5()`` PHP function).
66
67
.. _`Timing attack`: http://en.wikipedia.org/wiki/Timing_attack
0 commit comments