public static String encrypt(String key, String plainText){ String encryptTxt = ""; { byte[] salt = new byte[8];를 시도해 보세요. MessageDigest md = MessageDigest.getInstance("MD5"); md.update(key.getBytes()); 바이트[] 다이제스트 = md.digest(); for (int i = 0; i < 8; i++) { salt[i] = 다이제스트[i]; } PBEKeySpec pbeKeySpec = new PBEKeySpec(key.toCharArray()); SecretKeyFactory keyFactory = SecretKeyFactory .getInstance("PBEWithMD5AndDES"); SecretKey skey = keyFactory.generateSecret(pbeKeySpec); PBEParameterSpec paramSpec = new PBEParameterSpec(salt, ITERATIONS); 암호 암호 = Cipher.getInstance("PBEWithMD5AndDES"); cipher.init(Cipher.ENCRYPT_MODE, skey, paramSpec); byte[] cipherText = cipher.doFinal(plainText.getBytes()); String saltString = new String(Base64.encode(salt)); String ciphertextString = new String(Base64.encode(cipherText)); saltString + ciphertextString을 반환합니다. } catch (예외 e) { e.printStackTrace(); } return "";}将这段java 加密使用PHP进行解密