md5和sha1,base64的使用

md5
[root@localhost shell]# md5sum text.txt > text.txt.md5
[root@localhost shell]# cat text.txt.md5 
fe60c3cfe9414423c736dcc3e6c6d869  text.txt
[root@localhost shell]# md5sum -c text.txt.md5 
text.txt: 确定

sha1
[root@localhost shell]# sha1sum text.txt > text.txt.sha1
[root@localhost shell]# cat text.txt.sha1 
2d7bc09c938d40e396db72fb9739979a5fc24542  text.txt
[root@localhost shell]# sha1sum -c text.txt.sha1
text.txt: 确定

sh5和sha1是不可逆的
base64
[root@localhost shell]# base64 text.txt > text.txt.base64
[root@localhost shell]# cat text.txt.base64 
YWEKc2RmYQo=
[root@localhost shell]# base64 -d text.txt.base64 
aa
sdfa



猜你喜欢

转载自xiangjie88.iteye.com/blog/2390283