Advertisement
EiEich

Untitled

Nov 24th, 2018
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. global key1 := "nihuya ne poimesh okda"
  2. global key2 := "shifrator zaebis tak"
  3. global key3 := "eto ne nabor hui paimi kakih simvolov"
  4. Gui, Add, Edit, x43 y18 w380 h60 vText, Edit
  5. Gui, Add, Button, x42 y89 w90 h30 gcompile, Шифровать
  6. Gui, Add, Button, x332 y89 w90 h30 gdecompile, Дешифровать
  7. Gui, Show, w470 h136, Untitled GUI
  8. return
  9. GuiClose:
  10. ExitApp
  11. compile:
  12. Gui, Submit, NoHide
  13. total := cipher(text, key1, key2, key3)
  14. Clipboard := total
  15. MsgBox, % total
  16. return
  17. decompile:
  18. Gui, Submit, NoHide
  19. total := cipher(text, key3, key2, key1)
  20. Clipboard := total
  21. MsgBox, % total
  22. return
  23. Cipher(Src, Key1, Key2 = 0, Key3 = 0)
  24. {
  25. Loop, 3
  26. {
  27. If not Key%A_Index%
  28. Break
  29. StringSplit, Keys, Key%A_Index%
  30. Dest =
  31. Loop, Parse, Src
  32. {
  33. Index := Mod(A_Index, Keys0) + 1
  34.  
  35. Key := Asc(Keys%Index%)
  36. Code := Asc(A_LoopField)
  37. Dest .= Chr(Code = Key ? Code : Code ^ Key)
  38. }
  39. Src := Dest
  40. }
  41. Return Dest
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement