Пример #1
0
        public void GenerateText(IEnumerable <string> keys, string password, out string text)
        {
            SecurityKeyGenerator securityKeyGenerator = new SecurityKeyGenerator();

            text = securityKeyGenerator.GenerateTextFromKeys(keys.Select(x => new SecurityKey()
            {
                Key = x
            }), password);
        }
Пример #2
0
        public void GenerateText(IEnumerable <string> keys, string password)
        {
            SecurityKeyGenerator securityKeyGenerator = new SecurityKeyGenerator();

            try
            {
                string text = securityKeyGenerator.GenerateTextFromKeys(keys.Select(x => new SecurityKey()
                {
                    Key = x
                }), password);
                Console.WriteLine("Your Text :");
                Console.WriteLine(Environment.NewLine);
                Console.WriteLine(text);
            }
            catch (Exception)
            {
                Console.WriteLine("Error in Decrypting the Keys");
            }
        }
Пример #3
0
 public void GenerateKeys(string text, string password)
 {
     try
     {
         SecurityKeyGenerator securityKeyGenerator = new SecurityKeyGenerator();
         var val = securityKeyGenerator.GenerateKeys(text, password);
         if (val == null)
         {
             Console.WriteLine("Error in Generating Key");
         }
         int count = 0;
         foreach (var key in val)
         {
             Console.WriteLine($"Key {++count} :  {key.Key}");
         }
         Console.WriteLine(Environment.NewLine);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error in Encryption");
     }
 }
Пример #4
0
        public void GenerateKeys(string text, string password, out IEnumerable <SecurityKey> securityKeys)
        {
            SecurityKeyGenerator securityKeyGenerator = new SecurityKeyGenerator();

            securityKeys = securityKeyGenerator.GenerateKeys(text, password);
        }