JavaScript class to do two way hashing with secret key