Code example for IllegalBlockSizeException

Methods: getMessage

0
			return null; 
		} catch (NoSuchPaddingException e) {
			logger.warning("NoSuchPaddingException occured: " + e.getMessage());
			return null; 
		} catch (IllegalBlockSizeException e) {
			logger.warning("IllegalBlockSizeException occured: " + e.getMessage());
			return null; 
		} catch (BadPaddingException e) {
			logger.warning("BadPaddingException occured: " + e.getMessage());
			return null; 
		} 
	} 
	 
	public static String encryptMD5(final String toEncrypt){
		byte[] bytesOfMessage;
		try { 
			bytesOfMessage = toEncrypt.getBytes("UTF-8");
			final MessageDigest md = MessageDigest.getInstance("MD5");
			byte[] thedigest = md.digest(bytesOfMessage);
			final StringBuffer sb = new StringBuffer ();
			for (int i = 0; i < thedigest.length; i++){