Advertisement
MCFunRide

FunLabs Full Disk Encryption (Security Suite)

Aug 3rd, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1.  
  2.  
  3. os.loadAPI("/.endpoint/enc/Caesar")
  4.  
  5. local files = fs.list("/")
  6.  
  7. function encrypt()
  8. for i,v in pairs(files) do
  9. if v == "rom" then
  10. -- Do nothing
  11. elseif v == "disk" then
  12. -- Do nothing
  13. elseif v == ".endpoint" then
  14. -- Do nothing
  15. elseif v == "startup" then
  16. -- Do nothing
  17. else
  18. if fs.isDir("/"..v) then
  19. for i,k in pairs(fs.list("/"..v)) do
  20. f = fs.open("/"..v.."/"..k,"r")
  21. a = f.readAll()
  22. f.close()
  23. f = fs.open("/"..v.."/"..k,"w")
  24. f.writeLine(Caesar.encrypt(a,17))
  25. f.close()
  26. end
  27. else
  28. f = fs.open("/"..v,"r")
  29. a = f.readAll()
  30. f.close()
  31. f = fs.open("/"..v,"w")
  32. f.writeLine(Caesar.encrypt(a,17))
  33. f.close()
  34. end
  35. end
  36. end
  37. end
  38. end
  39.  
  40. function decrypt()
  41. for i,v in pairs(files) do
  42. if v == "rom" then
  43. -- Do nothing
  44. elseif v == "disk" then
  45. -- Do nothing
  46. elseif v == ".endpoint" then
  47. -- Do nothing
  48. elseif v == "startup" then
  49. -- Do nothing
  50. else
  51. if fs.isDir("/"..v) then
  52. for i,k in pairs(fs.list("/"..v)) do
  53. f = fs.open("/"..v.."/"..k,"r")
  54. a = f.readAll()
  55. f.close()
  56. f = fs.open("/"..v.."/"..k,"w")
  57. f.writeLine(Caesar.decrypt(a,17))
  58. f.close()
  59. end
  60. else
  61. f = fs.open("/"..v,"r")
  62. a = f.readAll()
  63. f.close()
  64. f = fs.open("/"..v,"w")
  65. f.writeLine(Caesar.decrypt(a,17))
  66. f.close()
  67. end
  68. end
  69. end
  70. end
  71. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement