Reference for jsSHA

jsSHA - A JavaScript implementation of the complete Secure Hash Standard family
            (SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512) by Brian Turek

About
-------------------------
jsSHA is a javaScript implementation of the complete Secure Hash Algorithm family as defined
by FIPS PUB 180-2 (http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf)

With the slow phasing out of MD5 as the standard hash to use in web applications, a client-side
implementation of the complete Secure Hash Standard family was needed.  Due to SHA-384 and SHA-512's
use of 64-bit values throughout the algorithm, JavaScript can not easily natively support the calculation
of these hashes.  As a result, a bit of hacking had to be done to make sure the values behaved themselves.
SHA-224 was added to the Secure Hash Standard family on 25 February 2004 so it was also included in this
package.

Files
-------------------------
src/sha.js
The complete SHA implementation

src/sha1.js
A smaller/web friendly implementation of only SHA-1.

src/sha256.js
A smaller/web friendly implementation of only SHA-224 and SHA-256.

src/sha512.js
A smaller/web friendly implementation of only SHA-384 and SHA-512.

src/wrapper.js
Wrapper functions to be added to the above script files if the jsSHA 0.1 interface is desired

test/test.html
A test page that calculates various hashes and has their correct values.

Usage
-------------------------
Include the desired JavaScript file (sha.js, sha1.js, sha256.js, or sha512.js) in your header (sha.js used below):
<script type="text/javascript" src="/path/to/sha.js"></script>

Instantiate a new jsSHA object with your string to be hashed as the only parameter.  Then, call getHash with the desired
hash variant (SHA-1, SHA-224, SHA-256, SHA-384, or SHA-512) and output type (HEX or B64).  In the example below,
"This is a Test" and "SHA-512" were used as the string to be hashed and variant respectively.

var shaObj = new jsSHA("This is a Test");
var hash = shaObj.getHash("SHA-512", "HEX");

NOTE: If you are using sha1.js, omit the SHA variant parameter as there is only one option.

Since the interface was changed drastically from 0.1 to 1.0, src/wrapper.js is included in case the old interface is desired.
Simply copy and paste the correct functions from wrapper.js to the bottom of the used jsSHA JS file.

Contact Info
-------------------------
The project's website is located at http://jssha.sourceforge.net/

Fix to "The handle is invalid" error when ASP.NET writes to the Eventlogs

Have you ever come across the error below with one of your ASP.NET web apps that is trying to write to the Eventlogs? If so, read on…

image

By default the ASPNET user cannot access the existing eventlogs categories. To resolve this, you must set the permissions in the Eventlog key in the registry:

  1. Launch RegEdit.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\.
  3. From the menu, select Edit->Permissions.
  4. Click the Add button and write ASPNET (if ASP.NET is running under a different User ID, use that ID instead).
  5. Click OK.
  6. Select the newly added user from the list (ASP.NET Machine User by default).
  7. Click on Full Control in the Allow column. 8. Click OK.

More info here.

How to install Subversion on hostmonster.com

After hours and hours of trying different methods, the steps below are what worked for me.  Many thanks to the geeks out there who wrote up steps like these, these, and these to get it up and running — it was invaluable for me to get it working on my mine.

Okay, the first thing is you’ll first need SSH access enabled on your account (more info here).  Once that’s done, use PuTTY, login into your account, then run the following commands (worked as of May 14, 2010) on a 32-bit server:

### installation ###
mkdir src
cd src

wget http://subversion.tigris.org/downloads/subversion-1.6.11.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.11.tar.bz2

tar -xjvf subversion-1.6.11.tar.bz2
tar -xjvf subversion-deps-1.6.11.tar.bz2
cd subversion-1.6.11

cd apr
./configure –enable-shared –prefix=$HOME
make
make install

cd ../apr-util
./configure –enable-shared –prefix=$HOME –with-expat=builtin –with-apr=$HOME –without-berkeley-db
make
make install

cd ../neon
./configure –enable-shared –prefix=$HOME –with-libs=$HOME –with-ssl
make
make install

cd ../
./configure –prefix=$HOME –without-berkeley-db –with-apr=$HOME –with-apr-util=$HOME –with-neon=$HOME –without-apxs –without-apache
make
make install

### add PATH of SVN to your user/account ###
cd ~
echo “PATH=\$PATH:\$HOME/bin/” >> .bashrc
echo “export PATH” >> .bashrc
source .bashrc

### create folder structure ###
mkdir svn
cd ~/svn
mkdir tmpdir
cd tmpdir
mkdir trunk
mkdir branches
mkdir tags

### create repository ###
svnadmin create /home/username/svn –fs-type fsfs
svn import . file:///home/username/svn –message ‘Initial repository structure’
rm -rf tmpdir

### grab user creation script ###
cd ~
wget www.sharpstep.com/Articles/HostMonster-svn/create_svn_user.sh
chmod a+x create_svn_user.sh

#### create SVN user ###
./create_svn_user username user_public_key

# clean up source
rm -rf src

That’s it!  All you have to do now is setup TortoiseSVN and PuTTY.