#touch a.php //create a.php file #vi a.php //edit a.php file with VI
<?php Echo MD5 (123456),?> input and save
#php a.php //Run a.php file
Display: e10adc3949ba59abbe56e057f20f883e
A. On Linux or UNIX, md5sum is the tool that is used to calculate and verify the file digest. In general, after installing Linux, there will be md5sum this tool, directly run directly at the command line terminal. You can use the following command to get the md5sum command to help man md5sum
#md5sum Help
There is a hint: "With no file, or when file was-, read standard input." "If the input file option is not available or the file option is--read the input from the tile", which can be encrypted by reading the string directly from the keyboard.
Ways to encrypt strings using md5sum
# md5sum //Then enter 123456 //input 123456. Then press two times ctrl+d.
Show:
123456e10adc3949ba59abbe56e057f20f883e
Red indicates the value after encryption
You can also use the pipe command:
#echo- n ' 123123 ' | md5sum
or write MD5 encryption script, called Md5.sh,
Copy the following into the script:
#!/bin/bashecho- N $ | md5sum | awk ' {print '} '
After saving, execute permissions to the script.
#sh md5.sh 123456
Display: e10adc3949ba59abbe56e057f20f883e
B. You can actually put the text in a text file, and then use md5sum encryption to change the text, you can also get the value of string encryption. The process is as follows:
#touch A.txt#echo- n 123456 > A.txt //write 123456 into a text file, do not lose the –n parameter, avoid the carriage return interference #md5sum A.txt
Display: e10adc3949ba59abbe56e057f20f883e a.txt
There are two meanings of ctrl+d:
One is to send the file entry terminator to the program EOF.
The
Second is to send exit instructions to the program. The program receives the signal after the specific action is to end the input, and then wait, or direct exit, it depends on how the program captures the signal after the operation. The
Md5sum belongs to the first meaning. Two plays Strl+d, the first time the EOF instruction is read, the capture will be treated as the exit instruction. A shell-type program will parse the CTRL+D directly into an exit instruction.