개정판 cbcc1a75
issue #00000 markup 바로가기 페이지 변경시 포커스 안 가는 현상 수정/확대범위 수정
Change-Id: If4d9e7f2a2915f7c491bcd46277800b7f833f3d3
FinalService/KCOM_FinalService/ConnectionStrEncrypt/Program.cs | ||
---|---|---|
11 | 11 |
{ |
12 | 12 |
static void Main(string[] args) |
13 | 13 |
{ |
14 |
//args = new string[2]; |
|
15 |
//args[0] = "-en"; |
|
14 |
Restart: |
|
16 | 15 |
|
17 |
//Console.WriteLine("ex) data source=address;database=database;user id=userid;password=password"); |
|
18 |
//Console.WriteLine("input Connection String :"); |
|
16 |
string connection; |
|
17 |
string value; |
|
18 |
string key = "Doftech1073#"; |
|
19 | 19 |
|
20 |
//args[1] = Console.ReadLine(); |
|
20 |
Console.WriteLine("ex) data source=address;database=database;user id=userid;password=password"); |
|
21 |
Console.Write("input Connection String : "); |
|
21 | 22 |
|
22 |
//args = new string[] { "-de", "oGKAXlIgXfRDRXGeHEn8EOYJBpEZdaR4TUqxSnjQeRQGAic7nOAFD0BzZ27j0u9NdhivuTsrcd+GXxxu0YVfH88OBZjEnWwEOO58gSOvKyw=" };
|
|
23 |
connection = Console.ReadLine();
|
|
23 | 24 |
|
24 |
if (args == null || args?.Count() == 0) |
|
25 |
{ |
|
26 |
args = new[] { "-en", "data source=211.38.140.182;database=markus;user id=doftech;password=etecenc09!$" }; |
|
27 |
//args = new[] { "-en", "data source=210.94.128.101;database=markus;user id=doftech;password=xpdhtm!1" }; |
|
28 |
//args = new[] { "-en", "data source=10.11.142.77;database=markus;user id=doftech;password=dof1073#" }; |
|
29 |
} |
|
30 | 25 |
|
31 |
String key = "Doftech1073#"; |
|
26 |
SelectEncrypt: |
|
27 |
|
|
28 |
Console.WriteLine("1.Encrypt 2.Decrypt"); |
|
29 |
Console.Write("Input 1 or 2 :"); |
|
30 |
|
|
31 |
value = Console.ReadLine().Trim(); |
|
32 | 32 |
|
33 |
if ((args.Length == 2) && (args[0] == "-en"))
|
|
33 |
if(value != "1" && value != "2")
|
|
34 | 34 |
{ |
35 |
String en = Encrypt(args[1], key);
|
|
36 |
Console.WriteLine("Encrypted Text is \"" + en + "\"");
|
|
35 |
Console.WriteLine("Try again");
|
|
36 |
goto SelectEncrypt;
|
|
37 | 37 |
} |
38 |
else if ((args.Length == 2) && (args[0] == "-de"))
|
|
38 |
else if(value == "1")
|
|
39 | 39 |
{ |
40 |
String de = Decrypt(args[1], key);
|
|
41 |
Console.WriteLine("Decrypted Text is \"" + de + "\"");
|
|
40 |
Console.WriteLine("Encrypt Connection String -");
|
|
41 |
Console.WriteLine(Encrypt(connection, key));
|
|
42 | 42 |
} |
43 | 43 |
else |
44 | 44 |
{ |
45 |
Console.WriteLine("Usage : ConnectionStrEncrypt.exe -en|-de <input string>"); |
|
45 |
Console.WriteLine("Decrypt Connection String -"); |
|
46 |
Console.WriteLine(Decrypt(connection, key)); |
|
46 | 47 |
} |
47 | 48 |
|
48 |
Console.ReadLine();
|
|
49 |
goto Restart;
|
|
49 | 50 |
} |
50 | 51 |
|
51 | 52 |
public static string Decrypt(string textToDecrypt, string key) |
내보내기 Unified diff