Sch Help Shell Scripting encryption 02

Source: Internet
Author: User

Sch Help Shell Scripting Encryption Geneva

I. Span style= "Word-wrap:break-word; Font-weight:normal; font-size:7pt; Font-family: ' Times New Roman ' ">   introduction

SHC (shell script compiler) shell script compiler. by SHC Compiled scripts are unreadable to ordinary users, so if you want your code to implement encryption to effectively mask sensitive information, consider using the SHC SHC

Ii. Span style= "Word-wrap:break-word; Font-weight:normal; font-size:7pt; Font-family: ' Times New Roman ' ">   Experimental test begins
2.1  download and compile SHC

[[email protected] ~]# wget http://www.datsi.fi.upm.es/~frosal/sources/ Shc-3.8.3.tgz[[email protected] ~]# ll shc-3.8.3.tgz-rw-r--r--1 root root 19874 Dec 20:40 shc-3.8.3.tgz[[email&n Bsp;protected] ~]# tar-zxvf shc-3.8.3.tgzshc-3.8.3/changesshc-3.8.3/copyingshc-3.8.3/makefileshc-3.8.3/ MATCHSHC-3.8.3/PRU.SHSHC-3.8.3/SHC.1SHC-3.8.3/SHC.CSHC-3.8.3/SHC.HTMLSHC-3.8.3/SHC. Readmeshc-3.8.3/test.bashshc-3.8.3/test.csh[[email protected] ~]# CD shc-3.8.3[[email protected] shc-3.8.3]# make && make install***? Do you want to probe SHC with a test script?*** please try ... make test[[email protected] shc-3.8.3]# 

2.2 after the compilation is complete, we switch to Oracle user to edit a script

[[email protected] ~]# Su-oracle[[email protected] ~]$ vi sqlscript.sql#!/bin/shsqlplus-s system/oracle << eofset PageSize 0 linesize Feedback offselect ' the database ' | | instance_name | |        ' has been running since ' | | To_char (Startup_time, ' Hh24:mi mm/dd/yyyy ') from v\ $instance; Select ' There is ' | | Count (status) | |        ' Data files with a status of ' | | Statusfrom Dba_data_filesgroup by Statusorder by Status;exit; Eof
2.3script before encryption is performed

[Email protected] ~]$/sqlscript.sqlthe Database Woo has been running since 18:17 12/23/2014there is 4 data files with A status of AVAILABLE
2.4encrypt the script to two more files on the original basis

[[email protected] shc-3.8.3]# shc-r-f/home/oracle/sqlscript.sql[[email protected] ~]$ ll sqlscript*-rwxr-xr-x 1 Oracle Oinstall 365 Dec 18:55 sqlscript.sql--run file-rwx--x--x 1 root root 12048 Dec 22:00 sqlscript.sql.x– encrypted binary file-rw-r-- r--1 root root 11416 Dec 22:00 sqlscript.sql.x.c--x source file (C language)
2.5after the encrypted file is executed, the output is the same as before the encryption

[Email protected] ~]$/sqlscript.sql.xthe Database Woo has been running since 18:17 12/23/2014there is 4 data files wit H A status of AVAILABLE
2.6 SHCOptional Parameters
[[email protected] shc-3.8.3]#./SHC-VSHC Parse (-f): No source file SPECIFIEDSHC USAGE:SHC [-E Date] [-M addr] [-I. IOPT] [-X CMND] [-l lopt] [-rvdtcah]-F script[[email protected] shc-3.8.3]#[[email protected] shc-3.8.3]#.  SHC--help./shc:invalid Option--'-' SHC parse:unknown optionshc Version 3.8.3, Generic Script COMPILERSHC Copyright (c) 1994-2005 Francisco Rosales &LT;[EMAIL&NBSP;PROTECTED]&GT;SHC USAGE:SHC [-E Date] [-M addr] [-i-iopt] [-X CMND] [-l lopt ] [-rvdtcah]-F script# Set expiration Time-e%s expiration date in dd/mm/yyyy format [None] #过期信息提示-M%s Message to display Upo n Expiration ["Please contact your provider"] #加密脚本名称-F%s File name of the script to compile-i%s Inline Option for the Shell interpreter i.e:-e-x%s eXec command, as a printf format i.e:exec ('%s ', @ARGV);-L%s last Shel Option i.e:--#宽松的安全性, you can figure out the operating system of the different machines running the-R Relax security. Make a redistributable binary-v Verbose compilation-d SwitCH on debug Exec calls [off]-t allow binary to be traceable [No] #显示许可证并退出-C Display License and exit-    A display abstract and exit #显示帮助和退出-H Display Help and exit environment variables Used:name Default Usage cc cc C compiler command CFLAGS <none> C compiler flags please consult the S HC (1) man page.





Sch Help Shell Scripting encryption 02

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.