|
The purpose of this page is to test my Javascript
implementation of the Secure Hash Algorithm (SHA-1). (See Federal
Information Processing Standards Publication (FIPS PUB) 180-1
[ HTML ]
[ PDF ]
for details.) Javascript implementations vary from browser to
browser, making a "correct" implementation extremely difficult.
My goal (however unrealistic :-) is to develop an implementation
that will run on virtually any javascript-capable
browser/operating system.
The test uses a set of random strings with lengths from zero
to 256 characters. Since the algorithm is intended
for use on the Web, only characters with ASCII values 32-126
(no high-ascii or unprintable characters) were used. The strings
are hashed using the SHA-1 algorithm, and the results are
compared to the hashes returned by the Microsoft
CryptoAPI.
For the browser to pass the test, all hashed values must match
exactly.
Instructions
Click the button below to begin the tests. The length of
the character strings increase sequentially. The longer
the string, the longer the test takes. The input box below and
the browser's status bar both show which value the browser is
currently processing. (Some browsers will not update the input
box until the script pauses, while some browsers update
the box but have problems with the status bar.) After every
50th test value has passed, you will be given the option to
stop testing. (If you do this, your results will not be
recorded.) Once the tests are completed, the results will be
automatically submitted.
Some browsers will pop up a dialog in the middle of the
tests asking if you want to stop because the script is taking too
long. Watch for this. If stop the script, your results will
not be counted.
If you have any problems, questions or comments, please
contact me.
|