[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Simple line-number based password manager

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 23
Thread images: 4

File: PHP-logo.svg.png (74KB, 1200x648px) Image search: [Google]
PHP-logo.svg.png
74KB, 1200x648px
Haven't written PHP in quite some time. Does this look reasonably secure? This is my small web based password manager. I'm assigning my accounts line numbers from a password file (1000 entries). You feed it an id (number 1-1000) and a pin (this version below is literally just "password"). Aside from the obvious plaintext password file it reads from, is there anything you can see that's obviously unsecured about this script? Anything you can see that could be easily exploited?
http://pastebin.com/raw/dnSMFn5v
>inb4 php is trash
>>
File: lemme off.gif (156KB, 500x375px) Image search: [Google]
lemme off.gif
156KB, 500x375px
Brump
>>
File: N5sfvM4.png (118KB, 465x357px) Image search: [Google]
N5sfvM4.png
118KB, 465x357px
>>
File: 200.gif (2MB, 267x200px) Image search: [Google]
200.gif
2MB, 267x200px
No PHP guys lurkin?
>>
Use hash_pass and dump anything SHA if you are serious about security
>>
>>59280512
>using php when node.js exists
>>
>>59280512
Nobody here can actually write programs .
>>
>>59280817
Huh. That's a neat feature. Some reading is in order.
>>
>>59280512
You should generate a different salt for each password and store it alongside the password.

Also I don't see you using a library that utilizes key stretching which is a bare necessity. But I can't be bothered to php so disregard if it is actually done.
>>
>>59280512
>>59280908

> Aside from the obvious plaintext password file

Also forgot to mention:
Never do this! Not even as a joke. You may know it is bs but the next best idiot coming across your code (might be a coworker or w/ever) is just blindly going to use it.
>>
>>59280931
I know it's not exactly smart to store passwords in plaintext, the server is just sitting at home and it's pretty tightly locked down. The web server is listening on a way high up port, as many precautions as I can take in order to be this lazy. The account/line number reference sheet is not even on the server. Both are useless unless put together.
>>
>>59280908
Doesn't hashing twice + salting achieve this?
>>
>>59281114
by that I mean the stretching*
>>
>>59280882
I suggest you set up a PDO instead of using plaintext because it's easier but that's up to you
>>
>>59280512

Use bcrypt if you are serious about security. It has builtin hashing (random for each entry) and unlike sha1/sha2 it's expensive (which makes it good).
>>
>>59280512

Use password_hash and password_verify. They were made for people like you who don't know how to cypto.
>>
>>59281403
Serious question. What's cryptographically wrong with this script for this purpose? Just the script itself, assuming the passwords will be stored properly at some point. (this is a proof of concept)
>>
>>59281455
A few things:
You shouldn't use the same salt for every password you get - this is a security issue. Generate a new random salt for each new username (line number, whatever) and store this with the salted+hashed password.

Don't use SHA, use bcrypt. SHA is not for cryptographic purposes, it's mathematically weak.

Hashing the already hashed password is unnecessary and won't add the security through obscurity that you think it will.
>>
>>59281505
That hash function is for one password. The script just pulls a specified line from a file and dumps it out if the password matches. It's always the same, it's a master password
>>
>>59281505

All of these points are valid which is why the PHP built in password functions do it this way.

Seriously OP, there's a reason you use real crypto libraries. Making your own functions just sets you up for Nintendo-tier security lapses.
>>
>>59280512

>weak comparision operator
Not sure if it's actually dangerous but it's bad form to do this.
>>
>>59281540
Ok - change the hashing method then and you could probably use it.

I'd advise storing the hashed password in bit form, and doing a bitwise comparison on it and your inputted password - I'm not too sure how PHP works with strings though.
>>
>>59281601
See I knew /g/ wasn't completely full of tryhards. All the other threads on this board are nonsense. There are some smart folks on here. Thanks for the advice. Much appreciated my man.
Thread posts: 23
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.