Subresource Integrity (SRI) Hash Generator

Compute cryptographic SHA-256, SHA-384, and SHA-512 hashes for CDN script and link tags to guarantee code integrity.

Recommended W3C SRI HTML Tag (SHA-384)
<script
  src="https://cdn.example.com/bundle.min.js"
  integrity=""
  crossorigin="anonymous"
></script>
SHA-384 (W3C Recommended Standard)Calculating...
SHA-512 (Maximum Collision Resistance)Calculating...
SHA-256Calculating...

What is Subresource Integrity (SRI)?

Subresource Integrity (SRI) is a W3C security specification that enables web browsers to verify that third-party assets fetched from CDNs (such as unpkg, cdnjs, or Google Fonts) have not been maliciously modified or compromised in transit.

How SRI Prevents CDN Supply-Chain Attacks

If an attacker compromises a public CDN and injects cryptocurrency miners or keyloggers into a popular JavaScript library, browsers loading that script without SRI will blindly execute the malicious code. With an integrity="sha384-..." attribute present, the browser hashes the downloaded file before execution; if the hash does not match, the browser immediately blocks execution and fires an error.

Why SHA-384 is the W3C Recommended Digest

While SHA-256 is supported, W3C recommends SHA-384 as the ideal balance between collision resistance, string length, and performance overhead during browser verification.