Anonomit

crack

Dec 16th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.65 KB | None | 0 0
  1. local customKey = "key" --can be changed to anything, in string format
  2. local hashFile = "hashfile" --path where hash file is stored. hash should be on line 1 of file
  3. local wordsList = "english-words-canada" --path to file containing words
  4.  
  5. local file = fs.open( hashFile, "r" )
  6. assert( file, hashFile .. " not found" )
  7. local key = file.readLine()
  8. file.close()
  9.  
  10. write( "hash is " )
  11. if term.isColor() then
  12.   term.setTextColor( colours.red )
  13. end
  14. print( key )
  15. if term.isColor() then
  16.   term.setTextColor( colours.white )
  17. end
  18. sleep( 0.5 )
  19. write( "." )
  20. sleep( 0.5 )
  21. write( "." )
  22. sleep( 0.5 )
  23. write( "." )
  24. sleep( 0.5 )
  25. print( "" )
  26. print( "Cracking..." )
  27.  
  28. local file = fs.open( wordsList, "r" )
  29. assert( file, wordsList .. " not found" )
  30.  
  31. local i = 1
  32.  
  33. while true do
  34.   local word = file.readLine()
  35.   if term.isColor() then
  36.     term.setTextColor( colours.white )
  37.   end
  38.   write( i .. ". Testing " )
  39.   if term.isColor() then
  40.     term.setTextColor( colours.yellow )
  41.   end
  42.   print( word )
  43.   i = i + 1
  44.   if hmac_sha1( customKey, word ) == key then
  45.     if term.isColor() then
  46.       term.setTextColor( colours.white )
  47.     end
  48.     write( "Success! '" )
  49.     if term.isColor() then
  50.       term.setTextColor( colours.yellow )
  51.     end
  52.     write( word )
  53.     if term.isColor() then
  54.       term.setTextColor( colours.white )
  55.     end
  56.     print( "' is correct!" )
  57.     write( "Found on trial " )
  58.     if term.isColor() then
  59.       term.setTextColor( colours.yellow )
  60.     end
  61.     write( i - 1 )
  62.     if term.isColor() then
  63.       term.setTextColor( colours.white )
  64.     end
  65.     print( "!" )
  66.     break
  67.   end
  68.   sleep( 0.01 )
  69. end --while true
  70.  
  71. file.close()
Add Comment
Please, Sign In to add comment