note 119399 added to function.openssl-seal

From: Date: Sat, 28 May 2016 07:58:48 +0000
Subject: note 119399 added to function.openssl-seal
Groups: php.notes 
Request: Send a blank email to php-notes+get-205601@lists.php.net to get a copy of this message
while the default is using RC4, it is possible to use other more secure algorithms. These are specified as the fifth parameter. Also, one needs to add an initialization vector (random bytes). Eg. <?php $data = "This is top secret."; // fetch public keys for our recipients, and ready them $cert = file_get_contents('./cert.pem'); $pk1 = openssl_get_publickey($cert); $iv = openssl_random_pseudo_bytes(32); openssl_seal($data, $sealed, $ekeys, array($pk1), "AES256", $iv); // free the keys from memory openssl_free_key($pk1); echo base64_encode($sealed); ?> ---- Server IP: 72.52.91.14 Probable Submitter: 85.154.227.65 ---- Manual Page -- http://php.net/manual/en/function.openssl-seal.php Edit -- https://master.php.net/note/edit/119399 Del: integrated -- https://master.php.net/note/delete/119399/integrated Del: useless -- https://master.php.net/note/delete/119399/useless Del: bad code -- https://master.php.net/note/delete/119399/bad+code Del: spam -- https://master.php.net/note/delete/119399/spam Del: non-english -- https://master.php.net/note/delete/119399/non-english Del: in docs -- https://master.php.net/note/delete/119399/in+docs Del: other reasons-- https://master.php.net/note/delete/119399 Reject -- https://master.php.net/note/reject/119399 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#205601) next »