我正在用登录表单中的密码搜索简单哈希.我遇到了这个http://tinsology.net/2009/06/creating-a-secure-login-system-the-right-way/.在这里他哈希密码,创建一个盐,然后再次哈希密码和盐.我自己正在构建一个登录表单,这是abc.php
<form name="register" action="register.php" method="post">
Username: <input type="text" name="username" maxlength="30" />
Password: <input type="password" name="pass1" />
Password Again: <input type="password" name="pass2" />
<input type="submit" value="Register" />
</form>
Run Code Online (Sandbox Code Playgroud)
提交后,register.php,它有
$u=$_REQUEST['username'];
$p=$_REQUEST['pass1'];
//salt create function
//hashing code
//final hash password
Run Code Online (Sandbox Code Playgroud)
然后在数据库中提交$ u和'final password'.
问:我的问题是从abc.php提交表单时,密码是否为文本?
如果是,那么有可能有人阅读它,然后需要哈希密码,因为即使我登录,我也会提交页面,并从另一页上的$ _REQUEST中检索通行证和用户名,其中它将被检查,它作为文本旅行,因此可以被某人阅读.
我正在构建一个白板,它将有一个服务器(教师)和客户(学生).老师会在他身边画一些东西,这些东西将与学生完全相同.
任何帮助,将不胜感激.
我有一个FileServer和一个FileClient,服务器在客户端连接时发送文件.这是一个简单的程序,只是为了理解背后的概念.
我能够将文件从服务器发送到客户端,缓冲区为1024.问题是收到的文件总是比原始文件少大约0.01 MB.因此mp3文件丢失了一些信息,而视频文件却没有玩.
我在服务器和客户端的while循环中放了一些prinln语句.我发现我的服务器没有发送整个文件.
//Server
byte [] mybytearray = new byte [1024];
FileInputStream fis = new FileInputStream(myFile);
BufferedInputStream bis = new BufferedInputStream(fis);
bis.read(mybytearray,0,mybytearray.length);
OutputStream os = sock.getOutputStream();
System.out.println("Sending...\n mybytearray length:"+mybytearray.length+"file length:"+(int)myFile.length());
int read, readTotal=0;
while ((read = fis.read(mybytearray,0,mybytearray.length)) != -1) {
os.write(mybytearray, 0, read);
System.out.println("File REad:"+read+"readtotal:"+readTotal); //*
readTotal += read;
}
System.out.println("Final File Read:"+read+" Final readtotal:"+readTotal);
os.flush();
sock.close();
}
Run Code Online (Sandbox Code Playgroud)
Println语句输出为:
Sending...
mybytearray length:1024file length:12767554
File REad:1024readtotal:0
File REad:1024readtotal:1024
.............and a lot of it...and then
File REad:1024readtotal:12756992
File REad:1024readtotal:12758016
File REad:322readtotal:12759040 …Run Code Online (Sandbox Code Playgroud)