我试图使用PHP mcrypt函数解密由Java Triple DES函数加密的密钥,但没有运气.在下面找到java代码
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class Encrypt3DES {
private byte[] key;
private byte[] initializationVector;
public Encrypt3DES(){
}
public String encryptText(String plainText, String key) throws Exception{
//---- Use specified 3DES key and IV from other source --------------
byte[] plaintext = plainText.getBytes();
byte[] myIV = key.getBytes();
byte[] tdesKeyData = {(byte)0xA2, (byte)0x15, (byte)0x37, (byte)0x08, (byte)0xCA, (byte)0x62,
(byte)0xC1, (byte)0xD2, (byte)0xF7, (byte)0xF1, (byte)0x93, (byte)0xDF,
(byte)0xD2, (byte)0x15, (byte)0x4F, (byte)0x79, (byte)0x06, (byte)0x67,
(byte)0x7A, (byte)0x82, (byte)0x94, (byte)0x16, (byte)0x32, (byte)0x95};
Cipher c3des = …
Run Code Online (Sandbox Code Playgroud) 需要从HttpClient的模型对象构建URL编码查询
我的模型是
class SaveProfileRequest
{
public string gName { get; set; }
public string gEmail { get; set; }
public long gContact { get; set; }
public string gCompany { get; set; }
public string gDeviceID { get; set; }
public string Organization { get; set; }
public string profileImage { get; set; }
public string documentImagefront { get; set; }
public string documentImageback { get; set; }
}
SaveProfileRequest request = new SaveProfileRequest() { gName = name, gEmail = …
Run Code Online (Sandbox Code Playgroud)