将参数用json的形式保存,并将数据用DES(Data Encryption Standard)
密钥加密算法加密,该算法的密钥key为**厂商密钥**。对加密后的数据进行Base64进行编码。
示例:
加密前的数据:
{"unionId":"7CCB0EEA","data":{"parkType":1,"address":"wewewewewew","parkName":"wwwwww","cityCode":100110,"lon":"13.2222222","userId":"123456","parkId":"wewewew","lat":"123.2222222"}}
需要加密的数据(**data对象中的数据**):
{"parkType":1,"address":"wewewewewew","parkName":"wwwwww","cityCode":100110,"lon":"13.2222222","userId":"123456","parkId":"wewewew","lat":"123.2222222"}
该数据利用DES密钥加密,密钥key="8A306C8C34A16891",再将加密后的数据进行Base64编码
加密后的数据:
kRk4Q03VAmNypf+/427C13wlGEqtSDo+j21ihmSXHTnJ87KWClo4SutxsFGoRlZmLu2m73VutIak\r\nHaaRI+7OKdipK7ZD/2Wbif3Uwi7H4KYBKackfM3BHOqGBofHR8Ddeas2CN9WmgcGzyToI9UTsc/3\r\nkgSmSefbazVJ+tzjwxhYK1HRBEvJIZxhET1jPwx3pw1Iix3WQq/sjfWPVNEOGQ==
需要传送的数据(**以json格式进行传输,即http的header里设置“Content-Type“为“application/json“,json中的字段有unionId和data两个字段**):
{"unionId":"7CCB0EEA","data":"kRk4Q03VAmNypf+/427C13wlGEqtSDo+j21ihmSXHTnJ87KWClo4SutxsFGoRlZmLu2m73VutIak\r\nHaaRI+7OKdipK7ZD/2Wbif3Uwi7H4KYBKackfM3BHOqGBofHR8Ddeas2CN9WmgcGzyToI9UTsc/3\r\nkgSmSefbazVJ+tzjwxhYK1HRBEvJIZxhET1jPwx3pw1Iix3WQq/sjfWPVNEOGQ=="}
### **下面两个接口都是用这种方式进行加密**