A method of verifying integrity of a root document in a set of files that define a web page, where said root document is downloaded from an untrusted web server to a user's web browser running on a computer that prevents entry of malicious code into said root document, said method comprising:
- providing said root document and making said root document available for download from said untrusted web server;
- downloading, by said user's web browser, said root document from said untrusted web server;
- obtaining, by said user's web browser, a cryptographic value from a trusted source, where said cryptographic value includes a reference hash;
- performing, by said user's web browser, a cryptographic analysis of the root document in conjunction with said cryptographic value, where said cryptographic analysis includes deriving a hash of the root document and comparing the derived hash with the reference hash;
- and
- verifying, by said user's web browser, the integrity of said root document only upon confirmation by said cryptographic analysis, where said confirmation includes confirming that the derived hash matches the reference hash.