Skip to Main Content
Secure Development for Mobile Apps
book

Secure Development for Mobile Apps

by J. D. Glaser
October 2014
Intermediate to advanced content levelIntermediate to advanced
472 pages
10h 44m
English
Auerbach Publications
Content preview from Secure Development for Mobile Apps
259
seCure Forms And ACCount regIstrAtIon
public function updateUsersPasswordHash($hash, $email)
{
global $db;
$db->updateUserPasswordHash($hash, $email);
}
public function updateUsersAccountEmail($id, $email)
{
global $db;
$db->updateUserAccountEmail($id, $email);
}
public function generateActivationCode()
{
//use best source of randomness first
$rawBytes = openssl_random_pseudo_bytes(OPEN_SSL_RANDOM_BYTES_SIZE);
//use mt_rand() as fallback if openssl not available or too slow
// generate a non-CSPRNG random salt with a fairly large collision
space
//this function generates a 64 char hash as a code
//if a larger code is required,
//use sha512 and a size of 128 for larger ACTIVATION_CODE_SIZE
//$salt = uniqid(mt_rand(), true);
$hashCode
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Developing with Web Standards

Developing with Web Standards

John Allsopp
Mobile Cloud Computing

Mobile Cloud Computing

Dijiang Huang, Huijun Wu

Publisher Resources

ISBN: 9781482209037