public string decryptMessage(string encryptedString)
 {
     byte[] EncryptedData = Convert.FromBase64String(encryptedString);
     byte[] DecryptedData = VCCryptography.RSADecrypt(EncryptedData);
     return(Encoding.UTF8.GetString(DecryptedData ?? new byte[0]));
 }
Beispiel #2
0
        public Main()
        {
            ConsoleManager.Show();
            _instance = this;
            Console.WriteLine("##Starting Server##");
            Console.WriteLine("APPLICATION_DATA_ROOT_DIR" + Constants.APPLICATION_DATA_ROOT_DIR);
            Console.WriteLine("Current Version: " + Version.currentVersion + "\nLatest Version: " + Version.latestVersion + "\nUp to Date: " + Version.isUpToDate + "\n");

            IDCodes.fill();
            serverName = Environment.MachineName;
            info       = new VolumeServer()
            {
                name = serverName, hasPassword = AuthentificationManager.Instance.usesPassword, id = VCCryptography.getPublicKey()
            };
            audioManager = new AudioManager();
            ListenerFactory.listener.startListening();

            if (!BroadcastReceiver.running)
            {
                broadcastThread = new Thread(new ThreadStart(BroadcastReceiver.findClients));
                broadcastThread.Start();
            }
            else
            {
                BroadcastReceiver.respondToNdRequests = true;
            }
            BroadcastSender.sendServerStartedBroadcast();
        }