public byte[] encryptData(byte[] msg){
		try {
            try {
                this.cipher.init(Cipher.ENCRYPT_MODE, this.key, this.ivspec);
            } catch (InvalidAlgorithmParameterException e) {
                LOGGER.log(Level.SEVERE, "Error building security cipher. [" + e.getMessage() + "]");
            }
            byte[] encryptedData = this.cipher.doFinal(msg);
			return encryptedData;
		} catch (InvalidKeyException e) {
			e.printStackTrace();
		} catch (IllegalBlockSizeException e) {
			e.printStackTrace();
		} catch (BadPaddingException e) {
			e.printStackTrace();
		}
        return null;
	}