What happened when you do the Java Encryption?

	//text is formatted as base64(iv+encrypted text)
	SecureRandom rnd = new SecureRandom();// to generate a random number

	byte[] encryptionKey = Encryptor.DoMD5( "Any string you want")
	// This encryption key helps to do decryption. 
	IvParameterSpec iv = new IvParameterSpec(rnd.generateSeed(16));// 16 is in used for both sides, it has to 

	SecretKeySpec  k = new SecretKeySpec(encryptionKey,"AES")//also, this keySpec can be randomly generated by KeyGenerator
	Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding");//The meaning of the string is "Algorithm name/Model name/Padding"
	c.init(Cipher.ENCRYPT_MODE, k, iv);

	byte[] sometextEncrypted  = c.update("Now you see me".getBytes());//this is the string you wanna enc
	byte[] textEncrypted = c.doFinal();//encrypted text

	def byteIv =  iv.getIV()
	byte[] combined = new byte[textEncrypted.length + byteIv.length]

	//this is to do: combined = byteIv+textEncrypted

	def s = combined.encodeBase64().toString()
	//this is the final encrypted text

	//to do the decryption:
	def decodeBase64String = s.decodeBase64()
	IvParameterSpec decIv = new IvParameterSpec(decodeBase64String,0,16)// get iv from the encrypted text

	c = Cipher.getInstance("AES/CBC/PKCS5Padding");//The type of cipher and KeySpec should be the same as encryption
	SecretKeySpec decK = new SecretKeySpec(encryptionKey,"AES")
	c.init(Cipher.DECRYPT_MODE,decK, decIv);//DECRYPT MODEL

	byte[] split  = new byte[16]
	//get encrypted text
	byte[] textDec = c.doFinal(split);

	print new String(textDec,"UTF-8")
	assertTrue textDec == "Now you see me"