Encrypt script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Encrypt script
# 1  
Old 03-10-2017
RedHat Encrypt script

Hi,
I have to encrypt my ash scripts on a distribution of linux with Armv5tejl Buildroot , I tried a lot of solutions but none works .
Someone can help me?
Thanks,
Nicola
# 2  
Old 03-10-2017
Okay. Please define 'none works'. Specifically what errors are you getting? for example, maybe 'Illegal instruction'? We cannot help otherwise.

Post the error messages you get, along with an idea of what you are trying.

Thanks!
# 3  
Old 03-10-2017
I tried to use SHC Shell Compiler but is only for bash script , I can't use make to install it , Can you recommend a useful method for me?
# 4  
Old 03-10-2017
Hi,

According to the documentation for SHC (which I freely admit I'd not heard of before now, so bear that in mind) it doesn't itself care what shell you're using. So long as the initial shebang line (the #! line that should be at the top of every script to define what shell to use) is intact, it will run the de-compiled script through that shell. So whether it's ash, bash or something else entirely shouldn't be relevant.

As per Jim McNamara's reply, if you can give the exact full text of any errors you're getting, a complete description of what commands you're trying, and ultimately explain precisely what it is you're attempting to achieve (and the reasons why), then it might be possible to help you further.
# 5  
Old 03-10-2017
RedHat

Thanks of the reply, I do not very experienced as you can see, you can advise me a suitable method to My esigienze to encrypt a script ash shell?Smilie
# 6  
Old 03-10-2017
This extremely common question always has the same inescapable conclusion.

Moderator's Comments:
Mod Comment If your database/machine/client can decrypt it at will without secrets -- so can anyone else.


Even if you shc it that doesn't prevent people from, say, copying it to a different machine without your permission, somewhere they can control what shell is used so as to extract the contents.

Yes, but --

Encryption does not work that way.

But what if --

Encryption does not work that way.

Maybe if it --

Encryption does not work that way.

To prevent people from reading your scripts/passwords, chmod.

To prevent people getting access to something which reads the scripts/passwords, sudo.

To prevent root from getting at it... You're out of luck.
These 2 Users Gave Thanks to Corona688 For This Post:
# 7  
Old 03-10-2017
Well. I'd say in case of compiling code there is no decryption. It's just binary code which can not be read and edited directly.

And SHC is a compile as I read it from what information google served me.

Of course you can use strace and figure out what's going on roughly. But this is not really that easy. And you cannot just add some lines of code here and there. Even though I would assume that it is not that difficult to exploit such shell scripts.

From my personal view Code-obfuscation and Code-Hiding is very annoying because you aren't able to fix or extend code anymore. Only good software producers that deliver rock solid code is a little less pain.

In very many cases, the code ist just bad and simple to fix bugs that can't be fixed are embarrassing.
This User Gave Thanks to stomp For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Encrypt and decrypt the password in a Shell Script

Hello, I have the following UNIX shell script which connects to the teradata database and executes the SQL Queries. For this, I am passing database name, username and password. I don't want to reveal my password to anyone. So, is there any way that I can encrypt my password and read the... (2 Replies)
Discussion started by: ronitreddy
2 Replies

2. Shell Programming and Scripting

Encrypt and decrypt a password in shell script

Hi All, very good morning all. I am trying to connect to informatica repository by using shell script. I have written pmrep connect command in the script file. But i need to provide repository, domain ,username and password to connect. Username and password are hard coded in the script... (8 Replies)
Discussion started by: SekhaReddy
8 Replies

3. Shell Programming and Scripting

Encrypt shell script

Hi, We have some scripts which will run in other project..So the requirement is that we dont want that they should see our code though they can run it. I have done some searching about how to encrypt the shell script and found SHC utillity as the answer. Can anybody please suggest how will... (11 Replies)
Discussion started by: millan
11 Replies

4. Shell Programming and Scripting

Encrypt DB password in Script

Hi, I have a SQL which i want to run through a shell script. query_result=`/home/oracle/product/11.2.0/bin/sqlplus -S uname/pwd@DBNAME <<! set heading off feedback off trimspool on set pagesize 0 set linesize 9999 spool $PARAM_PATH/param_name.txt; Select sysdate from dual; spool off;... (6 Replies)
Discussion started by: chetan.c
6 Replies

5. Shell Programming and Scripting

how to encrypt a password in shell script

Hi, I have run the below script which is connected to db2 v9.5. There is no issue. The only problem is how to encrypt the dbpwd? #!/bin/ksh #---- Set Environment dbalias="dev1db" dbuser="user1" dbpwd="password" #---- Connect to the Database cd /opt/ibm/db2/V9.5/bin db2 "connect to... (1 Reply)
Discussion started by: lookinginfo
1 Replies

6. Shell Programming and Scripting

How to hide/encrypt password in script?

Hi I have following problem Im writing a script (in bash ) , where need to be written login & passwd for databas client . Its need to in following form login passwd@dbhostname . The problem is so anybody can read it so the passwd & login are visible and thats not very safety . Can... (8 Replies)
Discussion started by: kvok
8 Replies

7. UNIX for Advanced & Expert Users

Encrypt the password ,source it in a expect script...!!

Hello folks I have a conf file ,say 'pass.conf' ,which is storing ascii password : PASS1111. I need to encrypt this password once and store it in a file. I ,then need to write a script which would read this encrypted password and decrypts it.The o/p o this script shud be this decrypted... (8 Replies)
Discussion started by: ak835
8 Replies

8. Shell Programming and Scripting

Encrypt and Decrypt script

Dear Experts, I am using one script name :volume.sh and its written in bash shell script. I just want to encrypt the script so that any one else cannot see it. please tell me the commands how to encrypt the script as well as to decrypt it. Regards, SHARY (9 Replies)
Discussion started by: shary
9 Replies

9. Shell Programming and Scripting

Expect Script....encrypt password and use

Could someone please help me...I have an expect script. There's a need for a log in during the script and a password is required...right now the password is just a variable in the expect script...what would be the best way to put that in an encrypted flat file and have the expect script pull the... (2 Replies)
Discussion started by: cubs0729
2 Replies

10. Shell Programming and Scripting

How to encrypt a script file

Dear all, I want to encrypt my script file so that other persons cannot change or view the script.How to do this ? Thanks, Nayanajith. (2 Replies)
Discussion started by: Nayanajith
2 Replies
Login or Register to Ask a Question