note 119577 added to function.openssl-decrypt

From: Date: Mon, 11 Jul 2016 06:04:37 +0000
Subject: note 119577 added to function.openssl-decrypt
Groups: php.notes 
Request: Send a blank email to php-notes+get-205960@lists.php.net to get a copy of this message
Parameters may seem obvius to some but not for everyone so: - $data can be as the description says raw or base64. If no $option is set (this is, if value of 0 is passed in this parameter), data will be assumed to be base64 encoded. If parameter OPENSSL_RAW_DATA is set, it will be understood as row data. - $password (key) is a String of [pseudo] bytes as those generated by the function openssl_random_pseudo_bytes(). - $options as (as for 2016) two possible values OPENSSL_RAW_DATA and OPENSSL_ZERO_PADDING. Setting both can be done by OPENSSL_RAW_DATA||OPENSSL_ZERO_PADDING. If no OPENSSL_ZERO_PADDING is specify, default pading of PKCS#7 will be done as it's been observe by [openssl at mailismagic dot com]'s coment in openssl_encrypt() - $iv is as in the case of $password, a String of bytes. Its length depends on the algorithm used. May be the best way to generate an $iv is by: <?php $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('your algorithm'));// for example you algorithm = 'AES-256-CTR' ?> ---- Server IP: 49.212.134.217 Probable Submitter: 157.65.39.189 ---- Manual Page -- http://php.net/manual/en/function.openssl-decrypt.php Edit -- https://master.php.net/note/edit/119577 Del: integrated -- https://master.php.net/note/delete/119577/integrated Del: useless -- https://master.php.net/note/delete/119577/useless Del: bad code -- https://master.php.net/note/delete/119577/bad+code Del: spam -- https://master.php.net/note/delete/119577/spam Del: non-english -- https://master.php.net/note/delete/119577/non-english Del: in docs -- https://master.php.net/note/delete/119577/in+docs Del: other reasons-- https://master.php.net/note/delete/119577 Reject -- https://master.php.net/note/reject/119577 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#205960) next »