Advertisement
gpgautier

testcrypt

Dec 15th, 2012
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. os.loadAPI("crypr")
  2.  
  3. local test = "gpgauier"
  4.  
  5. term.clear()
  6. term.setCursorPos(1, 1)
  7.  
  8. print("Test = " .. test)
  9.  
  10. local encrypted = crypr.encrypt(test)
  11.  
  12. print("Encrypted = " .. encrypted)
  13.  
  14. local decrypted = crypr.decrypt(encrypted)
  15.  
  16. print("Decrypted = " .. decrypted)
  17.  
  18. local file = fs.open("savedfile", "w")
  19. file.writeLine(encrypted )
  20. file.close()
  21.  
  22. file = fs.open("savedfile","r")
  23.  
  24. local fileEncrypted = file.readLine(1)
  25.  
  26. print("File Encrypted = " .. fileEncrypted)
  27.  
  28. local fileDecrypted = crypr.decrypt(fileEncrypted)
  29.  
  30. print("File Decrypted = " .. fileDecrypted)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement