Shell加密/解密工具

加密Shc

下载shc包:http://www.datsi.fi.upm.es/~frosal/sources/

安装shc

tar zxf shc-3.8.9.tgz.gz
cd shc-3.8.9/
make test
make strings
mkdir -p /usr/local/man/man1/  #是一个帮助文档所需要的目录
make install

shc 常用选项
-e date #(指定过期日期)-e  日/月/年
-m message #(指定过期提示的信息)-m "过期提示信息"
-f script_name #(指定要编译的shell的路径及文件名)
-r Relax security #(可以相同操作系统的不同系统中执行)
-v Verbose compilation #(编译的详细情况)

例如:脚本名字叫print.sh
shc -v -f  print.sh
-v 是现实加密过程
-f 后面跟需要加密的文件
print.sh.x为二进制文件,可直接执行。更改名字mv print.sh.x  print.sh
print.sh.x.c 是c源文件,可以删除。

脚本过期时间
shc -e 14/09/2016 -m "该文件已过期" -f print.sh
     -e    #指定过期时间,格式为“日/月/年”
     -m   #指定过期后执行此shell程序的提示信息。
注意:需要防止用户更改系统时间,可以通过在程序中加入自动更新系统时间的命令来解决此问题。

 

解密Unshc

下载Unshc包:https://www.asafety.fr/en/unshc-the-%20shc-decrypter/

解压后进入目录
/UnSHc-master/latest/unshc.sh   yourscripts.sh

详细教程:

https://github.com/yanncam/UnSHc
https://www.asafety.fr/prog-and-dev/bashshunix-shc-le-compilateur-et-protecteur-de-script-shell/
https://www.asafety.fr/en/unshc-the-%20shc-decrypter/

你可能感兴趣的:([Linux],[Shell])