Converting Java's PBEWithMD5AndDES to JavaScript
问题 I'm trying to replicate the Java code in JavaScript. below is my Java code: public static String encrypt(String input) final byte[] SALT= { (byte) 0x21, (byte) 0x21, (byte) 0xF0, (byte) 0x55, (byte) 0xC3, (byte) 0x9F, (byte) 0x5A, (byte) 0x75 }; final int ITERATION_COUNT = 31; { if (input == null) { throw new IllegalArgumentException(); } try { KeySpec keySpec = new PBEKeySpec(null, SALT, ITERATION_COUNT); AlgorithmParameterSpec paramSpec = new PBEParameterSpec(SALT, ITERATION_COUNT);