Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit64460d5

Browse files
committed
Added a tip about hashing the result of nextBytes()
1 parent9cf3b1e commit64460d5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎components/security/secure_tools.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,14 @@ to work correctly. Just pass a file name to enable it::
5454

5555
..note::
5656

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``.
57+
If you're using the Symfony Framework, you can get a secure random number
58+
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).
5966

6067
.. _`Timing attack`:http://en.wikipedia.org/wiki/Timing_attack

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp