can i encrypt a shell script
Hello everyone ,
is there any good way to encrypt a bash script to make no one view its contents & so cant edit it thanks for everyone |
You're looking for code obfuscation.
Google "obfuscate shell script" The first entry leads you here... http://www.comp.eonworks.com/scripts...-20011012.html I duno why you'd want to do that though. Kinda goes against the open source spirit amiright? |
Quote:
first thank you for helping me man ,& i really apreciate this so much second ,no i like open source, but i want this to encrypt a shell script that will do a project in our company & i want to be the only responsible one for this project ,as the company fired me since one month ago & returned me again then asked for this project, so i didnt want the company to take it,cuz it may fire me again or even if they did ,then they will feel that they really loose me,, maybe i'm bad in this thing ,but life is hard & i have a house & wife thanks again SAG & accept my best regards man |
Hello,
This also may be helpfull: Encrypting shell scripts Encrypting shell scripts 2 Kind regards, Eric |
You can encrypt them using openssl modules.
but in that case running them in openssl requires password to decrypt them & execute it..Make an entry on crontab with some prerequisite details. May it works |
I wonder. They probably do the encryption this way:
Encrypt: 1) Encrypt text of script. 2) Bind the encrypted text with an executable. Decrypt and Run: 1) Executable decrypts bound text. 2) Open a pipe. Run bash making it read the pipe just like a file. Send decrypted text to pipe. However I think the decrypted text sent to pipe can be intercepted.. somewhere or somehow. |
Quote:
There's two main methods of obfuscation that I can think of off of the top of my head. 1) take out all white spaces and comments and compact the code to a single line. (aka compacting) 2) Do same as #1 but in addition take and create an inhuman amount of variables and scramble them up in a confusing manner. Here's an example using Javascript... Plain text PHP Code:
PHP Code:
Quote:
SAM |
I'd fire you for handing in code like that.
Something to concider. |
@sag47 Then that's more on scrambling not encrypting since it's not intended to be read (decrypted to original source) on later part.
|
I never said it was encrypted, in fact I stated it was not encryption. He wanted to know how to hide the code. Code obfuscation is how one would do it without compiling it into a binary. People commonly mistake code obfuscation for encryption so usually when they ask for code encryption what they actually want is obfuscation. I seriously doubt the OP wants to enter a password just to have a script decoded each time it was ran. On top of any root level password needed.
|
Quote:
If you don't mind, have a look at the first link I posted in post #4. From that page: Quote:
Kind regards, Eric |
Quote:
Quote:
thanks alot for you ERIC & SAM & both of you accept my best regards :hattip: |
Hi,
You're welcome and I hope all goes well for you. Have a nice day. Kind regards, Eric |
Quote:
Quote:
|
@konsolebox: why are you breaking my balls man? The OP said it answered his question.
At any rate this is my last reply to this thread since it is now off topic. |
All times are GMT -5. The time now is 05:37 PM. |