Hi,
Is hash("sha256","string"); only usable in PHP 5 or does it work in version 4 too?
sha256 only in PHP 5?
Moderator: General Moderators
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
I have no experience with pecl extensions, but if I'm correct you could download the extensions themselves and therefore it would be possible to bundle them together with your script.
And otherwise there's feyd's SHA256 Hashing Algorithm
And otherwise there's feyd's SHA256 Hashing Algorithm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Yep, my class is there for environments where the hash extension is not enabled. I'm hoping to get the 2.0 interface out during Winter break, which starts tomorrow afternoon, that will have a completely different way of interacting with it and be far more flexible, tight and clean.
Anyways, I've tested my class in at late at 4.4.4. Provided E_STRICT is off, it should also run fine in 5, but I haven't really tested it.
2.0 will have separate versions for 4 and 5. The 5 branch will attempt to detect the availability of the hashing extension and use it where possible, however some operations will require the pure php implementation.
Anyways, I've tested my class in at late at 4.4.4. Provided E_STRICT is off, it should also run fine in 5, but I haven't really tested it.
2.0 will have separate versions for 4 and 5. The 5 branch will attempt to detect the availability of the hashing extension and use it where possible, however some operations will require the pure php implementation.
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Feyd you are very helpful man and thanks for that 
What do you think as a hashmaster, what of these is the most secure way to protect data?
$str = "to be hashed";
sha1(md5($str));
md5(sha1($str));
md5($str);
sha1($str);
Your library seemed very good, but to avoid any possible bugs, I decided not to use any non-rebuild functions as they may be a little unstable. Not saying your is unstable, but I do not want to take any risks.
PS. Sorry for spelling your name with capitalized 'F', I just always start a sentence with capitalized letter...
What do you think as a hashmaster, what of these is the most secure way to protect data?
$str = "to be hashed";
sha1(md5($str));
md5(sha1($str));
md5($str);
sha1($str);
Your library seemed very good, but to avoid any possible bugs, I decided not to use any non-rebuild functions as they may be a little unstable. Not saying your is unstable, but I do not want to take any risks.
PS. Sorry for spelling your name with capitalized 'F', I just always start a sentence with capitalized letter...
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Okay thank you, I trust youfeyd wrote:sha1() alone is more secure than the other three.