As everyone says, make sure experts analyze and try to break your cryptosystem even if it is largely pieced together from other cryptosystems in a secure manner. Even then, I would still treat it as a potential insecure application and only use it for "toy" needs (versus thinking it has been equally vetted compared to well known tools like openssl / GPG -- and even these tools have had well-publicized flaws found years later). Personally, you don't seem to be familiar with cryptographic hashes (thinking that SHA-256 can't encrypt more than 64-bits), so I strongly recommend taking a course or two on cryptography. (Coursera has two great courses by Dan Boneh; and udacity has a good course in Applied Cryptography).
It's very easy to use a javascript crypto library in a very weak way:
- have a user go to a web page, get served a javascript file over http from that webpage to perform cryptography (e.g., user types a phrase, enters a passphrase that derives a key and generates an encrypted message). This makes it trivial for an attacker to modify the JS file.
- Even using https to deliver it, means anyone at the delivering servers end could maliciously alter the file compromising its security. Therefore, this scenario fundamentally allows the server to alter the javascript file in a way that could compromise the security.
However, javascript (really ECMAScript) is just a programming language - it is not only used in web browsers from freshly served pages. It could be used in long lived browser extensions (downloaded once over SSL from a trusted source, run many times, in a manner analogous to how OpenSSL or GPG is initially downloaded once from a trusted source, installed, and run repeatedly), or as just another scripting language in the shell (node.js). A claim that "JS crypto is insecure" is roughly similar to say "python crypto is insecure" and not too far from "C++ crypto is insecure".
I'm not particularly familiar with Hash Commitment Before Knowledge protocol (and not really interested in learning about it as the link you mentioned talked about patent restrictions in the upper right), so will analyze a much simpler scenario where JS crypto could be used.
Alice and Bob both share a passphrase (established in person, generated randomly from a diceware dictionary) and have agreed on a good password based key derivation function (say 5000 rounds of SHA-512 and take first 256-bits) and a symmetric encryption protocol (AES-256 randomized CTR mode). They want to use cloud services (like google drive or dropbox or amazon web services) to store their encrypted data, but only store the javascript encryption/decryption script on a local non-shared computer they keep secure. In principle, they could use a JS crypto library to run AES-256, store it in their web-browser as a browser extension. They could both have the same browser extension stored on both their computers that upon input of their passphrase will generate their key and can encrypt or decrypt messages/files for them.
In this sort of scenario, timing attacks on the client-side local key generation phase would be irrelevant - as long as no network information goes out when the key begins to be generated. Replay attacks may be of significance, though messages could contain an encrypted time-stamp (so if you repeated the message "Transfer $100 from Alice to Bob- sent: July 4th, 2013 at noon" you won't repeat the action if you already performed the action on July 4th). Yes it would be trivial for an attacker with access to a computer with the browser extension to maliciously modify it (e.g., add a keylogger and record/transmit the key to someone). But this is not that different from an attacker installing a keylogger on a compromised machine or downloading the source code for OpenSSL, compiling it, and replacing OpenSSL with a compromised version. Again, if the computer you are using for encryption/decryption is compromised, don't expect to be able to keep your cryptosystem secure.
Granted as a browser extension, you must be very careful that you don't accidentally leak information via AJAX calls. Your web browser works with a lot of javascript files being executed simultaneously. For example, let's say you wanted to AES encrypt your gmail messages. You go to mail.google.com
press compose, start typing out your message in the compose window, finish your message, run your browser extension which replaces your plaintext in the message body with AES-encrypted ciphertext, and then press send. This is insecure. Gmail automatically sends your draft in the compose window to their servers via AJAX calls while you are typing it (to save as a draft in case your connection gets cut off).
PS: I deliberately have a flaw in my simple AES encryption scheme where no message authentication was present that would allow a man-in-the-middle to change a message "Attack at dawn" to "Attack at dusk" very easily. (Originally I wasn't going to point this out; but I'm trying to repeat the point that encryption is subtle").