System.arraycopy(encoded, 0, salt, 0, SALT_SIZE_BYTES);
System.arraycopy(encoded, 0, version, 0, VERSION.length); if (!Arrays.equals(version, VERSION)) throw ServiceException.FAILURE("unsupported version", null); System.arraycopy(encoded, VERSION.length, salt, 0, SALT_SIZE_BYTES);
    public static String decryptData(String dataSourceId, String data) throws ServiceException {        try {            byte[] encoded = Base64.decodeBase64(data.getBytes());            if (encoded.length < SALT_SIZE_BYTES + AES_PAD_SIZE)                throw ServiceException.FAILURE("invalid encoded size: "+encoded.length, null);            byte[] salt = new byte[SALT_SIZE_BYTES];            System.arraycopy(encoded, 0, salt, 0, SALT_SIZE_BYTES);            Cipher cipher = getCipher(dataSourceId, salt, false);            return new String(cipher.doFinal(encoded, SALT_SIZE_BYTES, encoded.length - SALT_SIZE_BYTES), "utf-8");        } catch (UnsupportedEncodingException e) {            throw ServiceException.FAILURE("caught unsupport encoding exception", e);        } catch (GeneralSecurityException e) {            throw ServiceException.FAILURE("caught security exception", e);         }    }