Hack Forums
[PHP] SecureYou 1.0 | PHP Library To Login/Register - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] SecureYou 1.0 | PHP Library To Login/Register (/showthread.php?tid=5600832)

Pages: Pages 1 2 3 4


SecureYou 1.0 | PHP Library To Login/Register - alemalakra - Apr 15, 2017

Secure You

About:
Spoiler (Click to View)

Sample Code:
Spoiler (Click to View)

Supported Versions:
Spoiler (Click to View)

Source Code:
Spoiler (Click to View)

Good Day!



* - EagleEye - Apr 15, 2017

good job i need some improvement's but good so far


* - alemalakra - Apr 16, 2017

(Apr 15, 2017 11:57 PM)961Group Wrote:  good job i need some improvement's but good so far

Thank you, Sure! I will add many more things in future updates


* - alemalakra - Apr 16, 2017

(Apr 16, 2017 07:41 AM)Yani Wrote:  Please don't make your own "encryption" for the password stuff. Use password_hash() and password_verify().

Right now it's not safe.

Sure because You can choose the size of the hash .. but hey, good point, for it to be used in web pages as crack? With a simple md5? That does not mean anything.

EDIT: And look well the function, is right .. in a while I publish the new version, with resetpassword and more things, Regards!


* - alemalakra - Apr 16, 2017

Sorry, I have already edited the post, if, as you say, it is a better idea, in a while I will publish that, because it is more efficient as well mentioned.


* - ASDA - Apr 16, 2017

what the fuck is this

why are you using one time pad for passwords, in fact why are you using ciphers at all



oh look now i've got your private key and all your passwords


* - alemalakra - Apr 16, 2017

(Apr 16, 2017 08:13 AM)ASDA Wrote:  what the fuck is this

why are you using one time pad for passwords, in fact why are you using ciphers at all



oh look now i've got your private key and all your passwords

If you did not use it well, as I said before. I will improve the FUCKING encryption of the passwords, happy? ...


* - ASDA - Apr 16, 2017

(Apr 16, 2017 08:16 AM)alemalakra Wrote:  If you did not use it well, as I said before. I will improve the FUCKING encryption of the passwords, happy? ...

calm down pal and it'd be better if you didn't use encryption at all

don't embarrass yourself


* - alemalakra - Apr 16, 2017

You will see how the code will grow, for tomorrow I will have SMTP support, with password reset and more things, I do not get angry, I ask you for your point of view


* - ASDA - Apr 16, 2017

(Apr 16, 2017 08:19 AM)alemalakra Wrote:  You will see how the code will grow, for tomorrow I will have SMTP support, with password reset and more things, I do not get angry, I ask you for your point of view

congratulations, i'm so proud of you & you got angry in your previous post, pipe down


* - alemalakra - Apr 16, 2017

Ok .. if you want to talk, send me skype: live: alemalakra
I already sent you request in tox, but you do not accept, here my tox id:
95E1574E91EE93CC2299B777A7EA5825BF290092E1BA2F3B2781F0264197433A8FB4FB6F7A47


* - MineSQL - Apr 16, 2017

Wanna improve your code? Let's step through it together.

1. You're using dependency injection, which is good - but you aren't declaring the variable as required to be PDO.


PHP Code

<?php 
public function __construct(\PDO $pdo, $encrypt){} 


2. You should probably be using a singleton pattern for the session_start, or wrap it inside it's own wrapper class so you can properly unit test this class. I'd probably op for a existing session management system - just google, there is bound to be tonnes. Be sure to use composer.

3. Use a proper password encryption engine like password_hash with BCRYPT. You're asking for trouble using base64...

4. Other than some small abstractions this isn't a terrible class. Be sure when you add new features you don't bloat your base code, and add functionality through dependencies.


* - alemalakra - Apr 16, 2017

(Apr 16, 2017 11:22 PM)MineSQL Wrote:  Wanna improve your code? Let's step through it together.

1. You're using dependency injection, which is good - but you aren't declaring the variable as required to be PDO.


PHP Code

<?php 
public function __construct(\PDO $pdo, $encrypt){} 


2. You should probably be using a singleton pattern for the session_start, or wrap it inside it's own wrapper class so you can properly unit test this class. I'd probably op for a existing session management system - just google, there is bound to be tonnes. Be sure to use composer.

3. Use a proper password encryption engine like password_hash with BCRYPT. You're asking for trouble using base64...

4. Other than some small abstractions this isn't a terrible class. Be sure when you add new features you don't bloat your base code, and add functionality through dependencies.

in a 1 hour, i add the new version, session in database support, and more things, Thanks!


@MineSQL Check Out New Version: https://github.com/Alemalakra/SecureYou/blob/master/src/secureyou.php


* - Malthael - Apr 17, 2017

Looking for your updates. :)


* - SIM-1073426 - Apr 17, 2017

(Apr 16, 2017 11:22 PM)MineSQL Wrote:  Wanna improve your code? Let's step through it together.

1. You're using dependency injection, which is good - but you aren't declaring the variable as required to be PDO.


PHP Code

<?php 
public function __construct(\PDO $pdo, $encrypt){} 


2. You should probably be using a singleton pattern for the session_start, or wrap it inside it's own wrapper class so you can properly unit test this class. I'd probably op for a existing session management system - just google, there is bound to be tonnes. Be sure to use composer.

3. Use a proper password encryption engine like password_hash with BCRYPT. You're asking for trouble using base64...

4. Other than some small abstractions this isn't a terrible class. Be sure when you add new features you don't bloat your base code, and add functionality through dependencies.

Big up for giving constructive criticism, who knows the class might even be popular in the future?

Keep working OP and learn how to handle criticism, I believe in you, the trick to success is time and effort which means if you put enough time into it then one day it'll be one of a kind.