CB Hash is a hash, not encryption. The only encryption that works on browsers is SSL, and that is seated in the browser, not the web application.
You cannot encrypt in JavaScript because the source is 100% available to any user of your website. So, people can just remove your encryption in the source.
Hashing is a one way process though, you cannot get the original data back out of it on the server.
You can hash it and have a comparison library on the server. I use something similar for the authentication on our website, but the server needs to have complete information or your comparison will fail.
As long as your secret is sufficiently complex, it will not be hackable.
Also, It is not entirely clear what you are trying to protect? Or are you just doing a non-repudiation scheme? The security will also depend very heavily on how you transmit your secret or the lifetime of the secret. Anyone with a wire shark and knowledge of which algorithm you are using can guess at your original information.