目前Javascript使用'crypto-js'包。
前后台可以自己跑通加解密,但是,无法互通。
针对对象{}加密……网上的方案,已经尝试了4天左右了,还没成功,请指导。
无思路,无报错。
Java
package com.pactera.sms.foundbase.util;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class AESUtils {
private static final String IV_STRING = "16-Bytes--String";
/**
* 加密方法
*
* @param seed
* 密钥
* @param clearText
* 明文
* @return
*/
public static String encrypt(String seed, String clearText) {
byte[] result = null;
try {
byte[] rawkey = getRawKey(seed.