Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

  

  

  Chilkat ActiveX Components

  Chilkat .NET Components

  Chilkat C++ Libraries

  

  

  

  

 

FAQ

SHA-1 Hash Text Tool   Back to Online Tools

This page should be viewed in Internet Explorer. It uses the Chilkat Crypt2 ActiveX component, which is a digitally signed and safe-for-scripting client-side component.

SHA-1 Test Vector

The Wikipedia entry for the SHA-1 algorithm provides a SHA-1 text vector for "The quick brown fox jumps over the lazy dog". The hash value (in hexidecimal format) is:

        2fd4e1c6 7a2d28fc ed849ee1 bb76e739 1b93eb12

You can verify that the Chilkat ActiveX computes the same value:

SHA-1 Hash this Text:

Javascript for SHA-1 Hash

<script type="text/javascript" language="javascript">

function sha1Hash()
{
	document.crypt2.UnlockComponent("Anything goes here.");
	
	document.crypt2.Charset = "iso-8859-1";
	document.crypt2.HashAlgorithm = "sha-1";
	document.crypt2.EncodingMode = "hex";
	
	document.form1.etx.value = 
			document.crypt2.HashStringENC(document.form1.etx.value);
}

</script>

The crypt2.HashStringENC method computes a hash value for a text string. The text is first (internally) converted to the crypt2.Charset prior to computing the hash. In this case, the Charset is set to "iso-8859-1" indicating that we want to hash the 1-byte per character encoding of a typical Western-European language string. If it were set to "unicode" for example, it would hash a string containing 2 bytes/char Unicode (and thus arrive at a different hash value).

About the Chilkat ActiveX Components for Client-Side Javascript / AJAX

The Chilkat ActiveX components are packaged in digitally-signed .cab files to ensure integrity and authenticity. The components are safe-for-scripting. When a Chilkat ActiveX detects that it is running in a browser, all local filesystem read/write functionality is disabled.

More information about Chilkat ActiveX in Javascript

Crypt2 ActiveX Reference

Embedding ActiveX in HTML Reference

More Online Tools


Privacy Statement. Copyright 2000-2010 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows 7, Vista, XP, 2000, 2003 Server, and Windows 95/98/NT4.