#touch a.php //create a.php file
#vi a.php //VI edit a.php file
<?php Echo MD5 (123456);?> input and save
#php a.php //Run a.php files
Show: e10adc3949ba59abbe56e057f20f883e
A. On Linux or UNIX, md5sum is the tool that is used to compute and validate the document digest. In general, the installation of Linux, there will be md5sum this tool, directly in the command line terminal to run directly. You can use the following command to get the md5sum command help man md5sum
There is a hint: "With no file," or "," The file is-, read standard input. " If you don't have the input file option or the file option is-, read the input from the tile, you can read the string directly from the keyboard to encrypt it.
Ways to encrypt strings using md5sum
# md5sum //Then enter
123456 //input 123456. Then press two times ctrl+d.
Show:
Copy Code code as follows:
123456e10adc3949ba59abbe56e057f20f883e
Red represents the encrypted value
You can also use the pipe command:
Copy Code code as follows:
#echo-n ' 123123 ' | Md5sum
or write MD5 encryption script, named Md5.sh,
Copy the following content into the script:
Copy Code code as follows:
#!/bin/bash
Echo-n $ | md5sum | awk ' {print '} '
After saving, execute permissions to the script.
Copy Code code as follows:
Show: e10adc3949ba59abbe56e057f20f883e
B. In fact, you can also put text into 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:
Copy Code code as follows:
#touch A.txt
#echo-N 123456 > A.txt//write 123456 into text file, cannot lose –n parameter, avoid return interference
#md5sum A.txt
Show: e10adc3949ba59abbe56e057f20f883e a.txt
Ctrl+d has two meanings:
One is to send the file input end EOF to the program.
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 directly exit, it depends on the program to capture the signal after how the operation.
Md5sum belong to the first meaning. Two times strl+d, the first time to read the EOF instruction, again capture will be used as exit instructions. and the Shell class of programs, will directly resolve the ctrl+d to exit instructions.