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.
I need how to pass the scores/ points from C2 game to server? I'm using ajax to submit scores from C2 game to server.
I used hash values to comparison in server. I have uploaded screenshot of my code. I'm comparing hash value come from game. Again i'm generating a hash value from my secret and score coming from game. This value and value come from game should be equal. If not data not update.
Someone has cheat on my game. using cheat engine.