How secure is the knapsack?
It may be possible to use the knapsack problem to build a secure cryptosystem, though experience suggests it is tricky and delicate.  There are many known algorithms for attacking the knapsack problem, which may or may not work, depending upon the specific parameters you choose.  Therefore, the security of the scheme will depend on the specific parameter values you use (e.g., the exact strategy you use for choosing all values, and the sizes of each value).

If you choose the weights $w_1,\dots,w_n$ independently and uniformly at random from a large enough space, and if $n$ is large enough, and if $S$ is chosen at random, then I suspect this should be secure (it'll probably be computationally infeasible to find $S$).  But I couldn't tell you exactly what parameter choices you'd need to make.  You'd need to read up on all known attacks on knapsack problems, including LLL-based algorithms and generalized birthday-based methods.  At minimum, I expect you need the weights to be (say) at least 256 bits long and $n \ge 160$, but I don't know if that is sufficient for security.

Are you using this only for one-wayness?  Can you use a standard one-way function (e.g., SHA256) instead, in lieu of the knapsack problem?  Or are you taking advantage of the special structure of the knapsack problem?