Narzędzia użytkownika

Narzędzia witryny


c-sharp-simplecrypt
no way to compare when less than two revisions

Różnice

Różnice między wybraną wersją a wersją aktualną.


Poprzednia wersja
c-sharp-simplecrypt [2018/07/16 11:47] (aktualna) – edycja zewnętrzna 127.0.0.1
Linia 1: Linia 1:
 +===== C Sharp - proste szyfrowanie ======
  
 +<file>
 +    class crypt
 +    {
 +        protected string klucz = "nasz_Tajny_KLUCZ";
 +        public string text = "";
 +
 +        public string tcrypt(string ptext)
 +        {
 +            int x = 0;
 +            text = "";
 +            int i = 0;
 +            for (x = 0; x < ptext.Length; x++)
 +            {
 +                text += char.ToString((char)(ptext[x] + klucz[i]));
 +                i++;
 +                if (i == klucz.Length) i = 0;
 +            }
 +            return text;
 +        }
 +
 +        public string tcrypt(string ptext, string pklucz)
 +        {
 +            int x = 0;
 +            text = "";
 +            int i = 0;
 +            for (x = 0; x < ptext.Length; x++)
 +            {
 +                text += char.ToString((char)(ptext[x] + pklucz[i]));
 +                i++;
 +                if (i == pklucz.Length) i = 0;
 +            }
 +            return text;
 +        }
 +
 +        public string tencrypt(string ptext)
 +        {
 +            int x = 0;
 +            text = "";
 +            int i = 0;
 +            for (x = 0; x < ptext.Length; x++)
 +            {
 +                text += char.ToString((char)(ptext[x] - klucz[i]));
 +                i++;
 +                if (i == klucz.Length) i = 0;
 +            }
 +            return text;
 +        }
 +
 +        public string tencrypt(string ptext, string pklucz)
 +        {
 +            int x = 0;
 +            text = "";
 +            int i = 0;
 +            for (x = 0; x < ptext.Length; x++)
 +            {
 +                text += char.ToString((char)(ptext[x] - pklucz[i]));
 +                i++;
 +                if (i == pklucz.Length) i = 0;
 +            }
 +            return text;
 +        }
 +
 +    }
 +</file>
c-sharp-simplecrypt.txt · ostatnio zmienione: 2018/07/16 11:47 przez 127.0.0.1