bytes in 'str = new String(bytes, “UTF8”) ' and 'bytes = str.getBytes(“UTF8”)' not the same value
问题 I can see they are different than the bytes I created the string with! I have used "AES/CBC/PKCS5Padding" to get the string. public static void main(String[] args) { try { int randomNumber = CNStationQueueUtil.randInt(0, 99999); String key = "AES_KEY_TAKENUMB"; byte[] bytes = EncryptHelper.encrypt(key, String.format("%%%d%%%d", 1001, randomNumber)); String str = new String(bytes, "UTF8"); System.out.println("str = " + str); System.out.println(); byte[] utf8Bytes = str.getBytes("UTF8");