knapsack.java
/** Takes a private sequence and uses the given multiplier and modulus
	*   to convert it into a public sequence, if the multiplier is chosen well,
	*   then this will hide the details of the private sequence, so the
	*   encrypted message created with this public sequence is secure.
	*   @param privateSequence The private sequence to be kept secret
	*   @param modulus The modulus
	*   @param multiplier The multiplier to use.
	*   @return The public sequence to be published.
	*/
Takes a private sequence and uses the given multiplier and modulus
to convert it into a public sequence, if the multiplier is chosen well,
then this will hide the details of the private sequence, so the
encrypted message created with this public sequence is secure.
@param privateSequence The private sequence to be kept secret
@param modulus The modulus
@param multiplier The multiplier to use.
@return The public sequence to be published.
Takes a private sequence and uses the given multiplier and modulus to convert it into a public sequence if the multiplier is chosen well then this will hide the details of the private sequence so the encrypted message created with this public sequence is secure . @param privateSequence The private sequence to be kept secret @param modulus The modulus @param multiplier The multiplier to use . @return The public sequence to be published .
public static BigInteger[] publicSequence(BigInteger[] privateSequence, BigInteger modulus, BigInteger multiplier) {
		BigInteger[] publicSequence = new BigInteger[privateSequence.length];
		for (int i = 0; i < publicSequence.length; i++) {
			publicSequence[i] = (privateSequence[i].multiply(multiplier)).mod(modulus);
		}
		return publicSequence;
	}
public static BigInteger [ ] publicSequence ( BigInteger [ ] privateSequence , BigInteger modulus , BigInteger multiplier ) { BigInteger [ ] publicSequence = new BigInteger [ privateSequence . length ] ; for ( int i = 0 ; i < publicSequence . length ; i ++ ) { publicSequence [ i ] = ( privateSequence [ i ] . multiply ( multiplier ) ) . mod ( modulus ) ; } return publicSequence ; }
Takes a private sequence and uses the given multiplier and modulus
   to convert it into a public sequence, if the multiplier is chosen well,
   then this will hide the details of the private sequence, so the
   encrypted message created with this public sequence is secure.
Takes a private sequence and uses the given multiplier and modulus to convert it into a public sequence if the multiplier is chosen well then this will hide the details of the private sequence so the encrypted message created with this public sequence is secure .