# What Is SHA-1 (Secure Hash Algorithm 1)? Definition and Examples

> SHA-1 is a 160-bit hash function from 1995 with practical collision attacks, so it is no longer accepted for signing publicly trusted TLS certificates.

Source: https://ssl.sh/glossary/sha-1/
Last updated: 2026-11-10

SHA-1 is a [hash function](https://ssl.sh/glossary/hash-function/) designed by the NSA and published by NIST in FIPS 180-1 in 1995, producing a 160-bit digest. Theoretical weaknesses were published in 2005. In February 2017, researchers from Google and CWI Amsterdam announced SHAttered, the first public SHA-1 collision: two different PDF files with the same digest. In 2020 a chosen-prefix collision followed, the kind of attack that makes forging signed objects such as certificates realistic.

## Why it matters
Because a certificate signature covers a hash of the certificate, a broken hash undermines the signature. The CA/Browser Forum [Baseline Requirements](https://ssl.sh/glossary/baseline-requirements/) stopped the issuance of SHA-1 signed TLS certificates from 1 January 2016, and major browsers stopped accepting SHA-1 signed TLS certificates in early 2017. Today, certificates are signed with [SHA-256](https://ssl.sh/glossary/sha-256/) or SHA-384. SHA-1 still appears in harmless places, such as fingerprints shown by tools and HMAC-SHA1 in older cipher suites.

## Example
Check what hash a certificate's signature uses; `sha1WithRSAEncryption` on a leaf or intermediate is a red flag:

```bash
openssl x509 -in example.com.crt -noout -text | grep 'Signature Algorithm'
openssl x509 -in example.com.crt -noout -fingerprint -sha1
```

The second command computes a SHA-1 fingerprint locally, which says nothing about how the certificate was signed.

## Common misconceptions
- **"A SHA-1 fingerprint means the certificate uses SHA-1."** A fingerprint is calculated by whoever views the certificate, with any hash they choose; it is unrelated to the signature algorithm.
- **"Cipher suites ending in -SHA are broken because SHA-1 is broken."** Those suites use HMAC-SHA1, which does not rely on collision resistance. The reasons to retire them are CBC mode and missing AEAD.
- **"A root certificate self-signed with SHA-1 must be replaced."** A root is trusted because it is in the trust store, not because of its self-signature; the signatures on intermediates and leaf certificates are what matter.

## Related terms

- [哈希函数](https://ssl.sh/zh/glossary/hash-function/): 哈希函数（密码学哈希函数）把任意长度的输入映射为固定长度的摘要，且在计算上无法逆推输入，也无法找到摘要相同的两个输入。
- [SHA-256](https://ssl.sh/zh/glossary/sha-256/): SHA-256 是 SHA-2 哈希家族中输出 256 位摘要的成员，由 NIST FIPS 180-4 规定，是当今 TLS 证书签名和指纹的标准哈希算法。
- [数字签名](https://ssl.sh/zh/glossary/digital-signature/): 数字签名是用私钥对消息计算出的一个值，任何持有对应公钥的人都能验证它，从而确认消息来源和内容未被篡改。
- [证书指纹](https://ssl.sh/zh/glossary/certificate-fingerprint/): 证书指纹是对证书 DER 编码计算出的哈希值（通常用 SHA-256），用来唯一标识一张证书，它本身并不存储在证书里。
- [Baseline Requirements](https://ssl.sh/zh/glossary/baseline-requirements/): Baseline Requirements 是 CA/B 论坛制定的基线要求，规定公开信任的 CA 在验证、签发和吊销 TLS 服务器证书时必须遵守的规则。
- [根证书](https://ssl.sh/zh/glossary/root-certificate/): 根证书是位于证书链顶端、由 CA 自签名的证书，预装在操作系统或浏览器的信任库中，作为验证其他证书的信任锚。
