Advertisement
Guest User

Untitled

a guest
Sep 16th, 2014
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.12 KB | None | 0 0
  1. public string DoCrupt(string Text1, bool cry) //зашифровать (расшифровать) пароль
  2.         {
  3.             string cpass = "";
  4.             string rab = "kgkykdmvbgk6894jk5jflhjh12ykjfhgmv89vjdltkdjhgpyjdhy67hhl789123dnh6789";
  5.             if ( cry) //шифровать
  6.             {
  7.                 if (Text1.Length <= rab.Length) //
  8.                 {
  9.                     for (int i = 0; i < Text1.Length; i++)
  10.                     {
  11.                         cpass = cpass + Text1[i] + rab[i];
  12.                     }
  13.                 }
  14.                 else cpass = Text1; //вернуть не шифрованный
  15.             }
  16.             if (!cry) //расшифровать
  17.             {
  18.                 if (Text1.Length <= (rab.Length * 2)) //
  19.                 {
  20.                     for (int i = 0; i < Text1.Length; i++)
  21.                     {
  22.                         cpass = cpass + Text1[i];
  23.                         i++;
  24.                     }
  25.                 }
  26.                 else cpass = Text1; //вернуть не шифрованный
  27.             }
  28.             return cpass;
  29.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement