| | |
| | | */ |
| | | public static String sm4EncryptUtil(String params){ |
| | | SymmetricCrypto sm4 = SmUtil.sm4(KEY.getBytes()); |
| | | return sm4.encryptHex(params); |
| | | return sm4.encryptBase64(params); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static void main(String[] args) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("pageNum", 1); |
| | | jsonObject.put("pageSize",10); |
| | | jsonObject.put("code", 500); |
| | | jsonObject.put("msg","该账号已存在"); |
| | | jsonObject.put("data",null); |
| | | String strParams = JSON.toJSONString(jsonObject); |
| | | System.out.println(String.format("明文参数: %s", strParams)); |
| | | |