openssl gost 哈希算法
在使用openssl list 发现了gost
openssl list -digest-commands
blake2b512 blake2s256 gost md4
md5 rmd160 sha1 sha224
sha256 sha3-224 sha3-256 sha3-384
sha3-512 sha384 sha512 sha512-224
sha512-256 shake128 shake256 sm3
测试结果:
echo "" | openssl sha256
(stdin)= 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
echo "" | openssl gost
(stdin)= 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
echo "https://const.net.cn/" | openssl gost
(stdin)= d1865af543db74fbaae644002ebf838b4ff22b09fd9b8452813736dc1239964b
echo "https://const.net.cn/" | openssl sha256
(stdin)= d1865af543db74fbaae644002ebf838b4ff22b09fd9b8452813736dc1239964b
发现gost hash算法与sha256一样。。。
GOST R 34.11-2012是新的俄罗斯哈希函数标准。从2013年1月开始,GOST R 34.11-2012哈希函数已成为新的俄罗斯联邦标准哈希函数,取代了旧的GOST R 34.11-97。GOST R散列函数可以将最多2 512位的任何消息压缩为256位和512位,分别称为GOST R-256和GOST R-512。
在OpenSSL的obj_mac.h中
#define SN_id_GostR3411_2012_256 "md_gost12_256"
#define LN_id_GostR3411_2012_256 "GOST R 34.11-2012 with 256 bit hash"
#define NID_id_GostR3411_2012_256 982
#define OBJ_id_GostR3411_2012_256 OBJ_id_tc26_digest,2L
#define SN_id_GostR3411_2012_512 "md_gost12_512"
#define LN_id_GostR3411_2012_512 "GOST R 34.11-2012 with 512 bit hash"
#define NID_id_GostR3411_2012_512 983
#define OBJ_id_GostR3411_2012_512 OBJ_id_tc26_digest,3L
本文链接地址:https://const.net.cn/94.html