note 121983 added to function.hash-hmac

From: Date: Wed, 06 Dec 2017 00:02:21 +0000
Subject: note 121983 added to function.hash-hmac
Groups: php.notes 
Request: Send a blank email to php-notes+get-209318@lists.php.net to get a copy of this message
This Is The Most Secure Way To Hash Your Data, It Will Be Almost Impossible To Retrieve Your Data. -------------------------------------------------------- --- Create Two Random Keys And Save Them In Your Configuration File --- <?php // Create A Random Key echo base64_encode(openssl_random_pseudo_bytes(64)); ?> -------------------------------------------------------- <?php // Save The Keys In Your Configuration File define('FIRSTKEY','TNYazlbZ1Mq3HDMiEFDLrRMZBftFqpU2Ipytgytsc+jmQysE8lmigKtmGK+exB337ZOcAgwPpWmoPHL5niO3jA=='); define('SECONDKEY','z5hh/Kax4+HKZ8exOlvGlrHev/6ZynOEn904yiiIcWo/qLXWSfLkzm4NSJiGXu4uR7xxUowOkO26VqAi2p2DYQ=='); ?> -------------------------------------------------------- <?php function secured_hash($data) { $first_key = base64_decode(FIRSTKEY); $second_key = base64_decode(SECONDKEY); $first_hashed = hash_hmac('sha3-512', $data, $first_key, TRUE); $second_hashed = hash_hmac('sha3-512', $first_hashed, $second_key); return $second_hashed; } ?> ---- Server IP: 208.43.231.9 Probable Submitter: 128.199.193.75 ---- Manual Page -- http://php.net/manual/en/function.hash-hmac.php Edit -- https://master.php.net/note/edit/121983 Del: integrated -- https://master.php.net/note/delete/121983/integrated Del: useless -- https://master.php.net/note/delete/121983/useless Del: bad code -- https://master.php.net/note/delete/121983/bad+code Del: spam -- https://master.php.net/note/delete/121983/spam Del: non-english -- https://master.php.net/note/delete/121983/non-english Del: in docs -- https://master.php.net/note/delete/121983/in+docs Del: other reasons-- https://master.php.net/note/delete/121983 Reject -- https://master.php.net/note/reject/121983 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209318) next »