public EncryptionResult Encrypt(LogInRequest req) { EncryptionResult res; var UserID = req.UserID; var Password = req.Password; res = new EncryptionResult(); var A = Md5(Password + SALT1); res.RemoteVerifyStr = Md5(Md5(A + UserID) + SALT2); res.LocalVerifyStr = Md5(res.RemoteVerifyStr + SALT3); return res; }
public LogInResponse Login(LogInRequest req) { LogInResponse res; res = new LogInResponse(); if (req != null && !req.UserID.IsNullOrEmpity()) { JsonRequest jsonReq = new JsonRequest(); jsonReq.user = req.UserID; jsonReq.password = new Encryption.EncryptionContext().GetResult(req).RemoteVerifyStr; string postStr = jsonReq.ToJson(); string resStr = new HttpPost.HttpPost().Post(postStr); var jsonResp = resStr.ToJsonObj<JsonResponse>(); if (jsonResp != null && jsonResp.data != null) { res.Success = true; res.Data = jsonResp.data; } } return res; }
public EncryptionResult GetResult(LogInRequest req) { return encryption.Encrypt(req); }