On the Chor-Rivest knapsack cryptosystem