I am using phpseclib implementation AES and HMAC. But I dont know the best way to create random keys for these. What is the best way to do? Is there any built in function in phpseclib to create keys of the preferred length?
Tell me more
×
IT Security Stack Exchange is a question and answer site for
IT security professionals. It's 100% free, no registration required.
|
See the "Generating Keys" section of the Encryption documentation. It suggests using the following code to generate a random key:
For the sourceforge project, it appears that if you want a password-derived key, then you can use |
|||||||||
|
|
I woulds suggest using crypt_random_string. It's not in the 0.3.1 release but it is in the latest Git version. |
|||
|
|
