note 119986 added to function.openssl-encrypt
| From: | Kruthers | Date: | Tue, 04 Oct 2016 19:37:56 +0000 |
| Subject: | note 119986 added to function.openssl-encrypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-206773@lists.php.net to get a copy of this message | ||
There still seems to be some confusion about the "password" argument to this function. It
accepts a binary string for the key (ie. NOT encoded), at least for the cipher methods I tried
(AES-128-CTR and AES-256-CTR). One of the posts says you should hex encode the key (which is
wrong), and some say you should hash the key but don't make it clear how to properly pass the
hashed key.
Instead of the post made by anonymous, this should be more accurate info about the parameters:
data - BINARY string
method - regular string, from openssl_get_cipher_methods()
password - BINARY string (ie. the encryption key in binary)
options - integer (use the constants provided)
iv - BINARY string
This is not only from my testing, but backed up by the usage of this function by https://github.com/defuse/php-encryption
----
Server IP: 208.69.120.55
Probable Submitter: 50.149.58.125
----
Manual Page -- http://php.net/manual/en/function.openssl-encrypt.php
Edit -- https://master.php.net/note/edit/119986
Del: integrated -- https://master.php.net/note/delete/119986/integrated
Del: useless -- https://master.php.net/note/delete/119986/useless
Del: bad code -- https://master.php.net/note/delete/119986/bad+code
Del: spam -- https://master.php.net/note/delete/119986/spam
Del: non-english -- https://master.php.net/note/delete/119986/non-english
Del: in docs -- https://master.php.net/note/delete/119986/in+docs
Del: other reasons-- https://master.php.net/note/delete/119986
Reject -- https://master.php.net/note/reject/119986
Search -- https://master.php.net/manage/user-notes.php