Now I found out that my passwords were very insecure, and that rainbow tables would be able to easily find out my information. . . so I decided to try and encrypt them.
Is what I use, but it doesn't work. I get the error code: Parse error: syntax error, unexpected T_STRING, expecting '(' on line 57. line 57 is function enc(@string) {
anyone know what I am doing wrong? I am very new to this, and most of this was made using various tutorials and examples, so I probably went wrong somewhere. And also is this actually a secure way to encode my passwords?
Okay, I fixed it. It was because this was placed within and "else" statement. Like so:
and I fixed it by simply putting brackets before and after this sequence
else {
my code here
}
My new question is that is this always the case? My code worked perfectly fine before, and only when I added this encryption it decided not to work. Why? And is this also a secure way to store my passwords?
PHP:
function enc($string) {
$salt = "@x2p";
$hash = sha1(md5($salt.$string)).md5($string).sha1(md5(md5($string)));
return $hash;
}
//Encrypts the passwords.
$password = enc($password);
$repeatpassword = enc($repeatpassword);
Is what I use, but it doesn't work. I get the error code: Parse error: syntax error, unexpected T_STRING, expecting '(' on line 57. line 57 is function enc(@string) {
anyone know what I am doing wrong? I am very new to this, and most of this was made using various tutorials and examples, so I probably went wrong somewhere. And also is this actually a secure way to encode my passwords?
Okay, I fixed it. It was because this was placed within and "else" statement. Like so:
PHP:
else
function enc($string) {
$salt = "@x2p";
$hash = sha1(md5($salt.$string)).md5($string).sha1(md5(md5($string)));
return $hash;
}
//Encrypts the passwords.
$password = enc($password);
$repeatpassword = enc($repeatpassword);
//lots of other coding dealing with username, email, etc. etc.
and I fixed it by simply putting brackets before and after this sequence
else {
my code here
}
My new question is that is this always the case? My code worked perfectly fine before, and only when I added this encryption it decided not to work. Why? And is this also a secure way to store my passwords?
Last edited: