SHA1HASH

Name

SHA1, SHA1_Init, SHA1_Update, SHA1_Final - Secure Hash Algorithm

Synopsis

#include <openssl/sha.h>

unsigned char *SHA1(const unsigned char *d, unsigned long n,
                 unsigned char *md);

void SHA1_Init(SHA_CTX *c);
void SHA1_Update(SHA_CTX *c, const void *data,
                 unsigned long len);
void SHA1_Final(unsigned char *md, SHA_CTX *c);

Description

name="google_ads_frame" width="300" height="250" frameborder="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-5823754184406795&dt=1227504493009&output=html&slotname=5992934909&correlator=1227504493009&url=http%3A%2F%2Flinux.die.net%2Fman%2F3%2Fsha1_update&ea=0&ref=http%3A%2F%2Fwww.google.cn%2Fsearch%3Fsourceid%3Dchrome%26ie%3DUTF-8%26q%3DSHA1_Update&frm=0&ga_vid=118986923.1227504493&ga_sid=1227504493&ga_hid=2079827823&flash=9.0.124&u_h=1050&u_w=1680&u_ah=1020&u_aw=1680&u_cd=32&u_tz=480&u_his=1&u_java=true&u_nplug=9&u_nmime=24&dtd=10" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no">

SHA-1 (Secure Hash Algorithm) is a cryptographic hash function with a 160 bit output.

SHA1 () computes the SHA-1 message digest of the n bytes at d and places it in md (which must have space forSHA_DIGEST_LENGTH == 20 bytes of output). If md is NULL , the digest is placed in a static array.

The following functions may be used if the message is not completely stored in memory:

SHA1_Init() initializes a SHA_CTX structure.

SHA1_Update() can be called repeatedly with chunks of the message to be hashed (len bytes at data).

SHA1_Final() places the message digest in md, which must have space for SHA_DIGEST_LENGTH == 20 bytes of output, and erases the SHA_CTX .

Applications should use the higher level functions evp_digestinit(3) etc. instead of calling the hash functions directly.

The predecessor of SHA-1 , SHA , is also implemented, but it should be used only when backward compatibility is required.

Return Values

SHA1 () returns a pointer to the hash value.

SHA1_Init()SHA1_Update() and SHA1_Final() do not return values.

Conforming To

SHA: US Federal Information Processing Standard FIPS PUB 180 (Secure Hash Standard), SHA-1: US Federal Information Processing Standard FIPS PUB 180-1 (Secure Hash Standard), ANSI X9.30

See Also

ripemd(3), hmac(3), evp_digestinit(3)

History

SHA1 ()SHA1_Init()SHA1_Update() and SHA1_Final() are available in all versions of SSLeay and OpenSSL.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值