Tag Archives: Security

SHA-2 Hashing Using hash() in PHP

As of PHP 5.1.2 can use hash() to make an SHA-256 hash of a string. hash() is a builtin php function. Can hash with various algorithms. This will create a 256 bit hash value which requires a 64 length character field to store it. Each hex character requires 4 bits to store. $hash = hash(‘sha256′, […]

MD5, sha-1 and sha-2

md5 or sha1 creates 128 bit hash value of the original value. The original value cannot be obtained from a hash value. This is the best way to store a representation of passwords. These older hashing algorithms have weakness though. The SHA-2 family of hashing algorithms is latest and most secure methods to hash data. […]