yiisoft/yii2 — pull request #4121 by klimov-paul (2014-06-30 11:05:08+00:00)
Title: Fix #4114: `Security::generateRandomKey()`

Fix #4114
Method `Security::generateRandomKey()` changed to return ascii string in...stead of binary one.

It should be safe to use bin4hex conversion. Indeed it reduces the entropy of original binary IV, but it returns just what is needed - random string of specified length. It is up to the developer which length he whould use.
I have increased default length to keep the strength, this should be enough.