개정판 d1be84a0
issue #1187: fixed MARKUS.wxs for SNI
Change-Id: I9819791f672b67a7035db5e7a5ec4cb2d224b7db
FinalService/KCOM_FinalService/ConnectionStrEncrypt/Program.cs | ||
---|---|---|
11 | 11 |
{ |
12 | 12 |
static void Main(string[] args) |
13 | 13 |
{ |
14 |
//String originalText = "data source=ESB-DB;database={0};user id=ProjectPortalDBConn;password=ProjectPortalDBConn"; |
|
15 |
String originalText = "data source=cloud.devdoftech.co.kr,7777;database={0};user id=doftech;password=dof1073#"; |
|
14 |
///String originalText = "data source=cloud.devdoftech.co.kr,7777;database={0};user id=doftech;password=dof1073#"; |
|
16 | 15 |
String key = "Doftech1073#"; |
17 | 16 |
|
18 |
String en = Encrypt(originalText, key); |
|
19 |
String de = Decrypt(en, key); |
|
20 |
|
|
21 |
Console.WriteLine("Original Text is " + originalText); |
|
22 |
Console.WriteLine("Encrypted Text is " + en); |
|
23 |
Console.WriteLine("Decrypted Text is " + de); |
|
24 |
|
|
17 |
if ((args.Length == 2) && (args[0] == "-en")) |
|
18 |
{ |
|
19 |
String en = Encrypt(args[1], key); |
|
20 |
Console.WriteLine("Encrypted Text is \"" + en + "\""); |
|
21 |
} |
|
22 |
else if ((args.Length == 2) && (args[0] == "-de")) |
|
23 |
{ |
|
24 |
String de = Decrypt(args[1], key); |
|
25 |
Console.WriteLine("Decrypted Text is \"" + de + "\""); |
|
26 |
} |
|
27 |
else |
|
28 |
{ |
|
29 |
Console.WriteLine("Usage : ConnectionStrEncrypt.exe -en|-de <input string>"); |
|
30 |
} |
|
25 | 31 |
} |
32 |
|
|
26 | 33 |
public static string Decrypt(string textToDecrypt, string key) |
27 | 34 |
{ |
28 | 35 |
RijndaelManaged rijndaelCipher = new RijndaelManaged(); |
... | ... | |
74 | 81 |
byte[] plainText = Encoding.UTF8.GetBytes(textToEncrypt); |
75 | 82 |
return Convert.ToBase64String(transform.TransformFinalBlock(plainText, 0, plainText.Length)); |
76 | 83 |
} |
77 |
|
|
78 |
|
|
79 | 84 |
} |
80 | 85 |
} |
내보내기 Unified diff