Free Tool

SRI Hash Generator

Generate Subresource Integrity hashes for your scripts and stylesheets. Protect against CDN compromises and supply chain attacks.

Why Use Subresource Integrity?

CDN Protection

If a CDN is compromised, SRI prevents malicious code from being executed on your site.

Tamper Detection

Any modification to the file will change its hash, causing the browser to reject it.

Supply Chain Security

Protect your users from supply chain attacks targeting popular libraries.

Frequently Asked Questions

What is Subresource Integrity (SRI)?

SRI is a security feature that allows browsers to verify that resources (scripts, stylesheets) haven't been modified. When you include an integrity hash, the browser checks the file matches before executing it, protecting against CDN compromises or man-in-the-middle attacks.

Which hash algorithm should I use?

SHA-384 is recommended as the best balance of security and performance. SHA-256 is also secure but slightly weaker. SHA-512 provides the most security but is larger. All three are currently considered secure.

When should I use SRI?

Use SRI whenever loading JavaScript or CSS from a CDN or third-party source. This includes libraries like jQuery, React, Bootstrap, Tailwind, or any analytics/tracking scripts. If the CDN is compromised, SRI prevents malicious code from running.

What is the crossorigin attribute?

When using SRI with resources from other domains, you must include crossorigin='anonymous'. This enables CORS and allows the browser to perform the integrity check. Without it, the integrity attribute is ignored for cross-origin resources.

Can I use multiple hashes?

Yes, you can include multiple hashes separated by spaces. The browser will accept the resource if ANY of the hashes match. This is useful when transitioning between file versions or supporting multiple valid versions.

Secure Your Entire App

SRI protects against CDN attacks. VAS scans your entire application for exposed secrets, misconfigurations, and vulnerabilities.

Run Full Security Scan