namespace com.billdawson.crypto { public class CryptoServer { PRivate const int RSA_KEY_SIZE_BITS = 1024; private const int RSA_KEY_SIZE_BYTES = 252; private const int TDES_KEY_SIZE_BITS = 192;
public static void Main(string[] args) { int port; string msg; TcpListener listener; TcpClient client; SymmetricAlgorithm symm; RSACryptoServiceProvider rsa; //获取端口 try { port = Int32.Parse(args[0]); msg = args[1]; } catch { Console.WriteLine(USAGE); return; } //建立监听 try { listener = new TcpListener(port); listener.Start(); Console.WriteLine("Listening on port {0}...",port);