public static byte[] encrypt(byte[] unencryptedByteData,char[] password,byte[] salt) throws EncryptionException {
  byte[] encryptedData=encryptData(unencryptedByteData,password,salt);
  encryptedData=(encryptedData == null) ? new byte[]{} : encryptedData;
  byte[] encryptedDataWithSaltPrefix=new byte[encryptedData.length + IEncryptionService.CRYPTO_SALT_DEFAULT_LENGTH];
  System.arraycopy(salt,0,encryptedDataWithSaltPrefix,0,salt.length);
  System.arraycopy(encryptedData,0,encryptedDataWithSaltPrefix,salt.length,encryptedData.length);
  return encryptedDataWithSaltPrefix;
}

public static byte [ ] encrypt ( byte [ ] unencryptedByteData , char [ ] password , byte [ ] salt ) throws EncryptionException { byte [ ] encryptedData = encryptData ( unencryptedByteData , password , salt ) ; encryptedData = ( encryptedData == null ) ? new byte [ ] { } : encryptedData ; byte [ ] encryptedDataWithSaltPrefix = new byte [ encryptedData . length + IEncryptionService . CRYPTO_SALT_DEFAULT_LENGTH ] ; System . arraycopy ( salt , 0 , encryptedDataWithSaltPrefix , 0 , salt . length ) ; System . arraycopy ( encryptedData , 0 , encryptedDataWithSaltPrefix , salt . length , encryptedData . length ) ; return encryptedDataWithSaltPrefix ; }
encrypts the given byte data with the given password using the aes algorithm .
