【发布时间】:2013-01-17 17:52:37
【问题描述】:
对于我只有朋友知道的非常小的网站,我正在开发一个密码系统。我将密码保存在这样的 php 文件中。
<?php
if($_GET["p"]=="password"){
?>
user1 password1
user2 password2
<?php
}
?>
然后,我可以使用 file_get_contents(pass.php?p="password"); 读取密码而且我仍然可以通过写入 php 文件来写入密码,就像我写入文本文件一样。这种方法不安全吗?是否有不需要数据库的类似方法?我认为我的网站不需要加密,如果密码被泄露也不会造成太大影响。
【问题讨论】:
-
您确定您的朋友并且您不重复使用当前密码吗?
-
使用SQLITE
-
it wouldn't hurt too much if the passwords were compromised.随心所欲;解决安全问题。