Example #1
0
        public static void GenerateRecipientKeyPair()
        {
            var keyPair = PasswordSharing.GenerateKeyPair();

            Console.WriteLine($"PUBLIC KEY: {keyPair.Item1}");
            Console.WriteLine($"PRIVATE KEY: {keyPair.Item2}");
        }
Example #2
0
 public static void ValidatePasswordSharingInput(bool encryption, string[] arguments)
 {
     if (arguments != null)
     {
         const int keyLength = 44;
         if (arguments[0].Length == keyLength)
         {
             char[] message = PasswordSharing.ConvertUserInput(encryption, arguments[0].ToCharArray(), arguments[1].ToCharArray());
             if (message != Array.Empty <char>())
             {
                 Console.WriteLine(message);
             }
         }
         else
         {
             Console.WriteLine("Error: Invalid key length. Type the public or private key followed by the password to encrypt/decrypt.");
         }
     }
     else
     {
         Console.WriteLine("Error: Please enter a public or private key followed by the password to encrypt/decrypt.");
     }
 }