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

jLogin - SHA-256, Multi-Users, Manage with one command (no editing)!

Started by jesusthekiller, 22 June 2013 - 04:41 AM
jesusthekiller #1
Posted 22 June 2013 - 06:41 AM
jLogin

Hi all!
Since I have not ever released shell lock script nor door lock, that is my (hardcore) (a bit hardcore) version of it. It includes SHA-256 user password encryption, multi-users, anti-bruteforce, command to manage it and a bit more :)/>

Note on logins:
They are not case sensitive, all white chars are removed from login.

Note on passwords:
Case sensitive, can include white chars (\n, \t, etc.)

Anti-bruteforce:
  1. After every failed password you got to wait 1 second.
  2. After every 3 failed passwords you got to wait fail_counter * 5 seconds. It has fancy countdown :)/>
SHA-256:
All passwords are encrypted with sha256 hashing algorithm.

Multi-users:
Have as many users as you want!

Anty-terminate:
Can not be terminated. Restores os.pullEvent after login.

Hidden password:
Password is replaced with " " in terminal.

Downloads dependencies:
It will download sha256 lib and login command at first run. HTTP API required for that.

User Interface:
Not fancy - It's fast. You don't use login lock to look at fancy GUI, right?

Easy to use:
Whole lock can be controlled with one command (directory independent).

Commands:
  • login lock - Will lock computer
  • login adduser <login> <pass> - Add user
  • login deluser <login> <pass> - Remove user
  • login passwd <login> <old_pass> <new_pass> - Change password
Screens:
Spoiler












Download:
pastebin get U1SNKdpi startup
(it will remove "login" file if you have one)
Mackan90096 #2
Posted 25 June 2013 - 11:26 AM
Looks really nice! Will try when I get home
Zudo #3
Posted 25 June 2013 - 11:49 AM
I was trying to make a lock program that actually paused the running program, and resumed it. It failed.

This is proof that you don't need to do this! :)/> :)/>
theoriginalbit #4
Posted 25 June 2013 - 12:07 PM
nice, this was about the same time I released my first door lock too :P/> after I'd released a bunch of other programs….

i like the addition of lockout for x seconds :P/> kinda like iOS, only yours is on a linear scale, verses iOS which is on an exponential scale…

Some things to help make your OP a little nicer :)/>
[left]They are not case sensitive, all white chars are removed form login.[/left]
[left]
[/left]
[left]from*[/left]

[left]
Anty-bruteforce:
Anti*

Side note:
Why did you pick this? over just '*'
Password is replaced with " " in terminal.
[/left]
ShadowedZenith #5
Posted 25 June 2013 - 12:49 PM

Side note:
Why did you pick this? over just '*'
Password is replaced with " " in terminal.

A lot of *nix systems use ' ' vs '*' because it makes it more difficult for someone to count characters. I'd say he most likely used it for another security measure, just in case. But, I'm not him so not 100% sure on that :P/>
jesusthekiller #6
Posted 25 June 2013 - 01:08 PM
He is 100% right :)/>
typos fixed
:)/>
Lyqyd #7
Posted 26 June 2013 - 01:44 AM
It doesn't make a difference if the cursor blink is still shown.
ShadowedZenith #8
Posted 26 June 2013 - 08:50 AM
He could always just set the cursor position back to the first position after every character, right?
jesusthekiller #9
Posted 26 June 2013 - 11:29 AM
Nope, read() handles cursor, can not override it. I would have to write my own read… And it is still harder to count empty space than stars…
MudkipTheEpic #10
Posted 26 June 2013 - 11:58 AM
You could use something hacky; like this:


local oCursor=term.setCursorPos
term.setCursorPos=function() return nil end
oCursor(x,y) --Whereever you want to be
local pass=read(" ")
term.setCursorPos=oCursor
Sammich Lord #11
Posted 26 June 2013 - 12:00 PM
SHA256 isn't encryption. It's a one way hash.
theoriginalbit #12
Posted 26 June 2013 - 12:43 PM

local oCursor=term.setCursorBlink
oCursor(x,y) --Whereever you want to be
I think you saved the wrong function pointer…… :P/>
MudkipTheEpic #13
Posted 26 June 2013 - 12:55 PM
Oops >.<

Fixed.
jesusthekiller #14
Posted 27 June 2013 - 12:47 PM
SHA256 isn't encryption. It's a one way hash.
Well, it encrypts, no one said about decryption :P/>
ShadowedZenith #15
Posted 28 June 2013 - 08:40 AM
SHA256 isn't encryption. It's a one way hash.
Well, it encrypts, no one said about decryption :P/>

Not really, it hashes. Hashing is one way, encryption is two way. If it can't be reversed, then it isn't really encryption.
jesusthekiller #16
Posted 29 June 2013 - 06:25 AM
You haven't noticed the joke, right?
hazard1nc #17
Posted 01 July 2013 - 09:28 PM
Love this script :)/> i see no asterisks in my console, but more like the unix invisible password, and thats way better for me! Thanks for sharing this script!
CaptainSly #18
Posted 02 July 2013 - 09:02 AM
I really like this program! It made my day.
jesusthekiller #19
Posted 02 July 2013 - 03:42 PM
Thanks :D/>