Advertisement
KidBrine

BrineCrypt

Apr 19th, 2017
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. file, M = ...
  2. FF = fs.open(file,"rb")
  3. FF2 = fs.open("."..file,"wb")
  4. print("Special thanks to Anavrins for showing me security flaws")
  5. print("Password: ")
  6. z = read(string.char(4))
  7. N = 0
  8. math.randomseed(string.byte(string.sub(z,string.len(z)-1,string.len(z))))
  9. for i = 1,string.len(z) do
  10. N = N+math.random(string.byte(z,i))
  11. end
  12. Char = "PH"
  13. -- (RaidPro API coming soon)
  14. function spl(FR,F1,F2)
  15. FR = fs.open(FR,"rb")
  16. F1 = fs.open(F1,"wb")
  17. F2 = fs.open(F2,"wb")
  18. repeat
  19. CH = FR.read()
  20. if CH ~= nil then
  21. F1.write(CH)
  22. end
  23. CH = FR.read()
  24. if CH ~= nil then
  25. F2.write(CH)
  26. end
  27. until CH == nil
  28. FR.close()
  29. F1.close()
  30. F2.close()
  31. end
  32. function com(FW,F1,F2)
  33. FW = fs.open(FW,"wb")
  34. F1 = fs.open(F1,"rb")
  35. F2 = fs.open(F2,"rb")
  36. repeat
  37. CH = F1.read()
  38. if CH ~= nil then
  39. FW.write(CH)
  40. end
  41. CH = F2.read()
  42. if CH ~= nil then
  43. FW.write(CH)
  44. end
  45. until CH == nil
  46. FW.close()
  47. F1.close()
  48. F2.close()
  49. end
  50. -- (RaidPro API coming soon)
  51. if M == "enc" then
  52. while Char ~= nil do
  53. Char = FF.read()
  54. if Char ~= nil then
  55. Char = Char+N
  56. while Char > 255 do Char = Char-255 end
  57. FF2.write(Char)
  58. end
  59. end
  60. FF2.close()
  61. math.randomseed(string.byte(string.sub(z,string.len(z)-1,string.len(z))))
  62. spl("."..file,"."..file..1,"."..file..2)
  63. com("."..file,"."..file..2,"."..file..1)
  64. elseif M == "dec" then
  65. while Char ~= nil do
  66. Char = FF.read()
  67. if Char ~= nil then
  68. Char = Char-N
  69. while Char < 0 do Char = Char+255 end
  70. FF2.write(Char)
  71. end
  72. end
  73. FF2.close()
  74. math.randomseed(string.byte(string.sub(z,string.len(z)-1,string.len(z))))
  75. spl("."..file,"."..file..2,"."..file..1)
  76. com("."..file,"."..file..1,"."..file..2)
  77. end
  78. FF.close()
  79. fs.delete(file)
  80. fs.move("."..file,file)
  81. fs.delete("."..file..1)
  82. fs.delete("."..file..2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement