Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public static string Encrypt(string text, int key)
  2. {
  3. int result = 0;
  4. byte[] bytes = Encoding.ASCII.GetBytes(text);
  5. char chara;
  6. foreach (var item in bytes)
  7. {
  8. Console.WriteLine(System.Convert.ToInt32(item));
  9. result = System.Convert.ToInt32(item) + key;
  10. chara = (char)result;
  11. text += chara.ToString();
  12. }
  13.  
  14. return text;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement