Question

In alpha release of php5.6 a new hash algorithm gost-crypto was added. I tried to look into documentation but the only information I found that it is added and nothing else.

Also there is no information on google (due to the fact that it was released today).

So how should I use it (gost-crypto('hello'); does not work) and in what cases is is better then other already available hashes md5 or crypt?

Était-ce utile?

La solution

You can see the new tests here: https://github.com/php/php-src/blob/master/ext/hash/tests/gost.phpt?source=c

echo hash('gost-crypto', 'The quick brown fox jumps over the lazy dog'), "\n";

The relevant ticket with more explanations is here: https://github.com/php/php-src/pull/430

This adds a new hash identifier "gost-crypto" which uses the CryptoPro S-box tables as specified by RFC 4357, section 11.2.

GOST algorithm with CryptoPro S-Box generates different set of hash values. CryptoPro S-box is required among other for DNSSEC GOST signatures (RFC 5933).

See http://en.wikipedia.org/wiki/GOST_(hash_function)

Autres conseils

It's a hash algorithm, I guess you can use it now instead of say, CRYPT_BLOWFISH in functions that support it (like crypt()).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top