Advertisement
7seven77

Double password (passbreak is W.I.P.)

Aug 28th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- Revised By 7Seven77 (mc name is Topnotch477)
  2. --- this is a huge thing of code but the only things you might need to change are below this text and at very bottom :)
  3. --- before you change any code i suggest you get it and play with it to see what it does :)
  4.  
  5. sgt = false
  6. if sgt == false then
  7. redstone.setOutput("bottom",true) -- Change side, if needed
  8. end
  9.  
  10. pass = "password" --- make this your password
  11. enclvl = 0
  12. hash = {{'1','2','3','4'},{'5','6','7','8'}}
  13. patDec = {{'1','2','3','4'},{'5','6','7','8'}}
  14. patSol = "2552" --- make this your 4 digit code
  15. maxX = 4
  16. maxY = 2
  17. selI = {1, 1}
  18. strI = ""
  19. lenI = 4
  20. WdLen = 1
  21.  
  22. menu1 = {"Inbox", "Disk", "Exit"} --- Change any of theese if you please
  23. menu2 = {"received mail", "sent mail", "Back"} --- theese can only be access after the first menu has been passed
  24. mess1 = ""
  25.  
  26. function menu(x, y, op)
  27. n = table.maxn(op)
  28. pos = 1
  29. stop = false
  30. while stop == false do
  31. term.clear()
  32. term.setCursorPos(1,1)
  33. print("Encryption Level : " .. enclvl)
  34. for i=1,n do
  35. term.setCursorPos(x,y-n/2+i)
  36. if i==pos then
  37. print("> " .. op[i])
  38. else
  39. print(op[i])
  40. end
  41. end
  42. e, key = os.pullEvent("key")
  43. if key == 200 then
  44. pos = pos-1
  45. if pos == 0 then pos = n end
  46. end
  47. if key == 208 then
  48. pos = pos+1
  49. if pos == n+1 then pos = 1 end
  50. end
  51. if key == 28 or key == 57 then
  52. stop = true
  53. end
  54. end
  55. return pos
  56. end
  57.  
  58. function passBreak(p)
  59. a = "hack"
  60. for i = 1, string.len(p) do
  61. for j = 1, string.len(a) do
  62. term.clear()
  63. term.setCursorPos(1,1)
  64. print("Calculating...")
  65. print(string.sub(p, 1, i-1) .. string.sub(a,j,j))
  66. sleep(0.05)
  67. end
  68. end
  69. term.clear()
  70. term.setCursorPos(1,1)
  71. print("Password found :")
  72. print(p)
  73. print("This code dosnt currently work")
  74. print("Press any key to continue...")
  75. os.pullEvent("key")
  76. end
  77.  
  78. function decrypt(lvl, enc)
  79. term.clear()
  80. term.setCursorPos(1,1)
  81. if lvl >= enc then
  82. print("Decrypting...")
  83. sleep(lvl*0.5 + 1)
  84. print("done")
  85. enclvl = 0
  86. else
  87. print("Encryption level too high.")
  88. end
  89. print("Press Any key to continue...")
  90. os.pullEvent("key")
  91. end
  92.  
  93. function interface()
  94. stpI = false
  95. while stpI == false do
  96. term.clear()
  97. term.setCursorPos(1,1)
  98. print("Pattern Recognition")
  99. for i=1,maxY do
  100. term.setCursorPos(4,3+i)
  101. for j=1,maxX do
  102. if selI[1] == i and selI[2] == j then
  103. write("<" .. hash[i][j] .. ">")
  104. else
  105. write(" " .. hash[i][j] .. " ")
  106. end
  107. end
  108. end
  109. term.setCursorPos(1,9)
  110. write("Password : " .. strI)
  111. e, k = os.pullEvent("key")
  112. if k == 200 then selI[1] = selI[1] - 1
  113. elseif k == 208 then selI[1] = selI[1] + 1
  114. elseif k == 203 then selI[2] = selI[2] - 1
  115. elseif k == 205 then selI[2] = selI[2] + 1
  116. end
  117. selI[1] = (selI[1]-1)%maxY + 1
  118. selI[2] = (selI[2]-1)%maxX + 1
  119. if k == 57 or k == 28 then stpI = true end
  120. end
  121. strI = strI .. hash[selI[1]][selI[2]]
  122. term.setCursorPos(1,9)
  123. print("Password : " .. strI)
  124. end
  125.  
  126. function pattern()
  127. strI = ""
  128. stI = false
  129. while stI == false do
  130. interface()
  131. if string.len(strI) == WdLen*lenI then
  132. stI = true
  133. if strI == patSol then
  134. term.setCursorPos(1,10)
  135. print("Correct!")
  136. sleep(1)
  137. admin()
  138. else
  139. print("Incorrect!")
  140. sleep(1)
  141. end
  142. strI = ""
  143. end
  144. end
  145. end
  146.  
  147. function patDecode()
  148. term.clear()
  149. term.setCursorPos(1,1)
  150. if hash ~= nil then
  151. print("Calculating...")
  152. for j=1,maxY do
  153. term.setCursorPos(3,3+j)
  154. for i=1,maxX do
  155. write("* ")
  156. sleep(0.1)
  157. end
  158. end
  159. for j=1,maxY do
  160. term.setCursorPos(3,3+j)
  161. for i=1,maxX do
  162. write(patDec[j][i] .. " ")
  163. sleep(1)
  164. end
  165. end
  166. else
  167. print("Can't find pattern...")
  168. end
  169. print("\n\nPress any key to continue")
  170. os.pullEvent("key")
  171. end
  172.  
  173. function diskCheck(s)
  174. term.clear()
  175. term.setCursorPos(1,1)
  176. print("Searching...")
  177. sleep(0.5)
  178. if disk.isPresent(s) == false then
  179. print("disk drive empty.")
  180. sleep(1)
  181. else
  182. l = disk.getLabel(s)
  183. if l == "Password Breaker" then passBreak(pass)
  184. elseif l == "Decrypter Level 1" then decrypt(1, enclvl)
  185. elseif l == "Decrypter Level 2" then decrypt(2, enclvl)
  186. elseif l == "Decrypter Level 3" then decrypt(3, enclvl)
  187. elseif l == "Pattern Decoder" then patDecode()
  188.  
  189. else print("Disk empty or corrupt.")
  190. sleep(1)
  191. end
  192. end
  193. end
  194.  
  195. function showDoc(doc)
  196. term.clear()
  197. term.setCursorPos(1,1)
  198. print(doc)
  199. print("")
  200. print("Press any key to continue...")
  201. os.pullEvent("key")
  202. end
  203.  
  204. function ReceivedBox()
  205. stpB = false
  206. while stpB == false do
  207. ch = menu(1, 4, menu3)
  208. term.clear()
  209. term.setCursorPos(1,1)
  210. print("Dont go too crazy now...\n\nPress any key to continue...")
  211. os.pullEvent("key")
  212. end
  213. end
  214.  
  215.  
  216. function SentBox()
  217. stpB = false
  218. while stpB == false do
  219. ch = menu(1, 4, menu3)
  220. term.clear()
  221. term.setCursorPos(1,1)
  222. if ch == 1 then
  223. showDoc(mess1)
  224. else
  225. stpB = true
  226. end
  227. end
  228. end
  229.  
  230. function admin()
  231. stp = false
  232. while stp == false do
  233. ch = menu(20, 8, menu2)
  234. term.clear()
  235. term.setCursorPos(1,1)
  236. if ch == 1 then
  237. SentBox()
  238. elseif ch == 2 then
  239. ReceivedBox()
  240. else
  241. stp = true
  242. end
  243. end
  244. end
  245.  
  246. st = false
  247. while st == false do
  248. o = menu(20, 8, menu1)
  249. if o == 1 then
  250. term.clear()
  251. term.setCursorPos(1,1)
  252. if enclvl > 0 then
  253. print("Page Encrypted...")
  254. print("Press Any key to go back to the menu...")
  255. os.pullEvent("key")
  256. else
  257. print("Password Required...")
  258. write("Password : ")
  259. pw = read()
  260. if pw == pass then
  261. print("Correct!")
  262. sleep(0.5)
  263. print("This computer is Protected by a Pattern System.")
  264. sleep(1)
  265. pattern()
  266. else
  267. print("Incorrect!")
  268. print("Press any key to go back to the menu...")
  269. os.pullEvent("key")
  270. end
  271. end
  272. elseif o == 2 then
  273. diskCheck("left")
  274. else
  275. st = true
  276. end
  277. end
  278. term.clear()
  279. term.setCursorPos(1,1)
  280. print("Shutting Down ...")
  281. sleep(1)
  282. os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement