string timestamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
string EncryptId = "LD14-1" + timestamp;
string EncryptPw = "1111" + timestamp;
string timestamp1 = string.Empty, EncryptId1 = string.Empty, EncryptPw1 = String.Empty;
byte[] inputByteArray = null;
string Key = "wnTC/SBZr9m458b6GlNbkEWUSDaVykTSSEq8tq2OZJw=";
string IV = "zGqPHNC1ePvmCuAFs+xd0Q==";
using (System.Security.Cryptography.AesCryptoServiceProvider csp = new System.Security.Cryptography.AesCryptoServiceProvider())
byte[] rgbKey = Convert.FromBase64String(Key);
byte[] rgbIV = Convert.FromBase64String(IV);
using (MemoryStream ms = new MemoryStream())
using ( System.Security.Cryptography.CryptoStream cs = new System.Security.Cryptography.CryptoStream(ms, csp.CreateEncryptor(rgbKey, rgbIV), System.Security.Cryptography.CryptoStreamMode.Write))
inputByteArray = Encoding.UTF8.GetBytes(timestamp);
cs.Write(inputByteArray, 0, inputByteArray.Length);
timestamp1 = Convert.ToBase64String(ms.ToArray());
using (MemoryStream ms = new MemoryStream())
using ( System.Security.Cryptography.CryptoStream cs = new System.Security.Cryptography.CryptoStream(ms, csp.CreateEncryptor(rgbKey, rgbIV), System.Security.Cryptography.CryptoStreamMode.Write))
inputByteArray = Encoding.UTF8.GetBytes(EncryptId);
cs.Write(inputByteArray, 0, inputByteArray.Length);
EncryptId1 = Convert.ToBase64String(ms.ToArray());
using (MemoryStream ms = new MemoryStream())
using ( System.Security.Cryptography.CryptoStream cs = new System.Security.Cryptography.CryptoStream(ms, csp.CreateEncryptor(rgbKey, rgbIV), System.Security.Cryptography.CryptoStreamMode.Write))
inputByteArray = Encoding.UTF8.GetBytes(EncryptPw);
cs.Write(inputByteArray, 0, inputByteArray.Length);
EncryptPw1 = Convert.ToBase64String(ms.ToArray());
Console.WriteLine(String.Format("?timestamp={0}&EncryptId={1}&EncryptPw={2}", timestamp, EncryptId1, EncryptPw1));
Console.WriteLine(String.Format("?timestamp={0}&EncryptId={1}&EncryptPw={2}", Uri.EscapeDataString(timestamp), Uri.EscapeDataString(EncryptId1), Uri.EscapeDataString(EncryptPw1)));