This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
FoxData's profile picture

[WIP] FoxLock - A lock for your computer [WIP]

Started by FoxData, 05 April 2016 - 07:18 PM
FoxData #1
Posted 05 April 2016 - 09:18 PM
FoxLock



Do you play on a server where people look down your computers files? Well foxlock will lockdown your computer with a password.

Download:
SpoilerPastebin get 4HKNQVCL foxlock

Screenshots:
SpoilerNo screenshots yet. But its just a black screen with text

Pastebin link:
Spoilerhttp://pastebin.com/4HKNQVCL



This Program is work in progress - Some features may change over the course of development.
Copyright MMXVI FoxData
Konlab #2
Posted 05 April 2016 - 09:49 PM
My opinion:
- Hardcoded password (server owners can view files)
- No filesystem encryption
How can it be improved?
- Encrypt password and save it to a file
- Encrypt/Decrypt filesystem when shutdown/startup
- Indent code
Edited on 11 June 2016 - 01:35 PM
FoxData #3
Posted 16 July 2016 - 07:29 PM
Do you remember the issues with the first version of foxlock? Well we have released a new version called FoxLock 2.0!

FoxLock 2.0


This is a redefined version of FoxLock with all new features and security. But still the same function,


What does "universal" mean?
SpoilerUniversal it what FoxData refers to a program that will work on every type of CC computer (Command, Advanced, Basic,) However this does not mean that program is compatible with pocket computers

How to install
SpoilerSave it as a startup file and reboot the computer. FoxLock will then guide you through the process

Code
Spoiler

--FoxLock 2.0
--(C) FoxData/ry00000 2016
os.pullEvent = os.pullEventRaw
if not fs.exists(".fl-pass") then
term.clear()
term.setCursorPos(1,1)
print("It looks like you're running FoxLock 2 for the 1st time!")
print("You're gonna have to set a password if you want to use FoxLock!")
print("Enter your desired password at the Pass> prompt.")
print()
write("Pass>")
local pass = read("*")
local passFile = fs.open(".fl-pass", "w")
passFile.write(pass)
passFile.close()
print("OK, you're all set now! Reboot your computer and enjoy FoxLock 2!")
print("This computer will automatically reboot in 5 seconds.")
sleep(5)
os.reboot()
end
while true do

term.clear()
term.setCursorPos(10,5)

local file = fs.open(".fl-pass", "r")
local password = file.readLine()
file.close()
term.setCursorPos(10,5)
print("Welcome to FoxLock 2.")
print()
print("FoxLock ver. 2.0 (C) FoxData/ry00000 2016")

term.setCursorPos(5,10)
print("Please Enter your password:")
term.setCursorPos(33,10)
local input = read("*")

if input == password then
print("Access granted.")
sleep(2)
term.clear()
term.setCursorPos(1,1)
break
else
-- Do Nothing
end
  end

Download
Spoilerpastebin get uYpmjbVw startup

Copyrights
SpoilerMIT License

Copyright © [2016] [FoxData and ry000000]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Edited on 16 July 2016 - 05:35 PM
Lyqyd #4
Posted 16 July 2016 - 07:49 PM
Threads merged. Feel free to update the topic title and original post.
Luca_S #5
Posted 16 July 2016 - 08:15 PM
You definitely didn't fix any security issues.

You should hash the password before saving it to a file(And you should also salt this), there are plenty of good APIs on the forums, like this one by Anavrins: http://www.computercraft.info/forums2/index.php?/topic/8169-sha-256-in-pure-lua/page__view__findpost__p__246117

If you want I can give you a little explanation on how to use it.
ry00000 #6
Posted 20 July 2016 - 10:34 AM
Oh yeah I forgot. I'll get to it.
ry00000 #7
Posted 20 July 2016 - 10:44 AM
Luca_S I would like an explanation on how to use Anavrins' API.
Edited on 20 July 2016 - 08:45 AM