The Secure Hash Algorithm (SHA) is a family of cryptographic hash functions that turns data of any length into a fixed-length digest, or fingerprint. It underpins integrity checks, digital signatures, and certificate trust, and it authenticates tunnels in IPsec, TLS, and DTLS.
Key takeaways
- SHA turns any input into a fixed-length digest that verifies integrity.
- SHA-1 is deprecated; SHA-2 (SHA-256, SHA-384, SHA-512) is the current baseline.
- SHA-3 uses a different internal design as a structural backup to SHA-2.
- HMAC-SHA combines SHA with a secret key to authenticate messages.
- Versa’s IKE, IPsec, TLS, and DTLS transforms all offer SHA-based hashing.
On this page: Why it mattersHow it worksTypesSHA & VersaFAQ
Why is SHA important?
Nearly every mechanism that proves data has not been altered depends on a hash function, and SHA is the family the internet standardized on. Certificate authorities sign certificates with SHA-based digests; TLS and IPsec sessions use SHA, directly or through HMAC, to confirm packets weren’t tampered with in transit; and software distributors publish SHA-256 checksums so downloads can be verified.
That reliance is also why SHA’s history matters. SHA-1, dominant for two decades, was broken by a practical collision attack in 2017, forcing browsers and certificate authorities to migrate to SHA-2. Knowing which SHA variant a system uses is a basic prerequisite for judging whether its integrity guarantees still hold.
What is SHA?
A hash function takes an input of any size and produces a fixed-length output – the digest. SHA-256, for example, always returns 256 bits, whether the input is one byte or one gigabyte. Three properties make this useful: the function is one-way (recovering the input is computationally infeasible), deterministic (the same input always produces the same digest), and collision-resistant (finding two different inputs with the same digest should be practically impossible).
Used alone, SHA fingerprints data for integrity checks. Combined with a secret key as HMAC-SHA (Hash-based Message Authentication Code), it authenticates messages – proving both that data wasn’t altered and that it came from someone holding the shared key. This is what IPsec and TLS use to authenticate packets and handshake messages.
Types of SHA
SHA-1 produces a 160-bit digest and was published in 1995. A demonstrated collision attack (the 2017 “SHAttered” research) broke its collision resistance, and it is now deprecated for new deployments – though it still appears in legacy configuration options.
SHA-2 is the current standard, published in 2001. It is a family of digest sizes – SHA-224, SHA-256, SHA-384, SHA-512, and truncated variants – with SHA-256 the most common baseline for TLS certificates, code signing, and IPsec transforms. SHA-2 has no known practical collision attack.
SHA-3, published in 2015, is structurally different: it uses a sponge construction (Keccak) rather than the Merkle–Damgård design shared by SHA-1 and SHA-2. It was standardized as a backup, not a replacement, and sees less deployment in networking protocols than SHA-2 does today.
SHA & Versa
Versa’s Secure Access Service configuration exposes SHA directly in tunnel cryptography. Configuring the IKE Transform for a secure access server or SASE client profile pairs an encryption algorithm (3DES, AES 128-bit, or AES 256-bit) with a hashing algorithm – MD5, SHA-1, SHA-256, SHA-384, or SHA-512 – for the key-exchange control channel. The IPsec (ESP) Transform offers the same SHA choices for the data-plane tunnel, alongside GCM modes that fold authentication into the cipher instead of pairing it with a separate SHA hash.
SHA also appears in the TLS and DTLS cipher suites offered for secure access portals and SASE client sessions – for example, TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384 – where the trailing SHA variant sets the handshake’s integrity algorithm. Administrators tune SHA strength per tunnel across Secure SD-WAN and NGFW-fronted deployments alike: prefer SHA-256 or stronger, and treat SHA-1 and MD5 as compatibility-only.
Frequently asked questions
What is the difference between SHA-1 and SHA-256?
SHA-1 produces a 160-bit digest and is broken against collision attacks, so it should not be used for new security purposes. SHA-256, part of the SHA-2 family, produces a 256-bit digest, has no known practical collision attack, and is the current recommended baseline.
Is SHA encryption or hashing?
Hashing, not encryption. Encryption is reversible with the right key; hashing is one-way by design – there is no key to recover the original input from a SHA digest. SHA verifies data integrity and, combined with a key as HMAC, authenticates it.
Why was SHA-1 deprecated?
In 2017, researchers demonstrated a practical collision – two different inputs producing the same SHA-1 digest – breaking the property that made SHA-1 trustworthy for signatures and certificates. Browsers and certificate authorities subsequently required SHA-2 or later for new certificates.
What is HMAC-SHA, and how does it differ from SHA alone?
HMAC-SHA combines a SHA hash function with a secret key to produce a keyed authentication code. Plain SHA proves data wasn’t altered; HMAC-SHA additionally proves the sender held the shared key, which is what IPsec and TLS use to authenticate tunnel traffic.
Which SHA variant should I use today?
SHA-256 is the practical default for certificates, TLS handshakes, and IPsec transforms today. SHA-384 or SHA-512 add extra margin for higher-assurance deployments that can absorb the larger digest size. SHA-1 and MD5 should be limited strictly to interoperability with legacy peers that cannot be upgraded.
More on SHA
If you want to learn more, these are sources we trust.
| RFC 3174: US Secure Hash Algorithm 1 (SHA1) | RFC 6234: US Secure Hash Algorithms (SHA and HMAC) |
|---|---|
| The original IETF specification of the SHA-1 algorithm, including pseudocode and a full reference implementation for verification. | The IETF specification covering SHA-1 and the SHA-2 digest family, plus the SHA-based HMAC and HKDF constructions built on them. |
Related terms
If you’re reading about SHA, these are worth looking at next.
| Advanced Encryption Standard | Galois/Counter Mode | Datagram Transport Layer Security |
|---|---|---|
| The symmetric cipher SHA is most often paired with in IPsec and TLS transforms to provide encryption alongside integrity. | An authenticated encryption mode that folds hashing into the cipher itself, offered as an alternative to separate AES-plus-SHA transforms. | A UDP-based tunnel protocol whose cipher suites, like TLS’s, embed a SHA variant for handshake integrity. |