add encrypt method from http://cwestblog.com/2011/10/17/quick-javascript-encryption-method/