How to encrypt a shell (bash) script? [closed]
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
I have a shell script I want to encrypt in order to hide my code.
Please do not suggest SHC, because it is breaking (editor's note: explanation needed).
shell-script encryption
closed as unclear what you're asking by Rui F Ribeiro, Romeo Ninov, Vlastimil, Jeff Schaller, Michael Homer May 8 at 20:16
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
 |Â
show 4 more comments
up vote
-1
down vote
favorite
I have a shell script I want to encrypt in order to hide my code.
Please do not suggest SHC, because it is breaking (editor's note: explanation needed).
shell-script encryption
closed as unclear what you're asking by Rui F Ribeiro, Romeo Ninov, Vlastimil, Jeff Schaller, Michael Homer May 8 at 20:16
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Is there a reason simply using GPG is insufficient? You can encrypt any file, not just scripts, using the method outlined here: gnupg.org/gph/en/manual/x110.html
â John Moon
May 8 at 16:57
can it break script ?
â MeMaTi
May 8 at 16:59
3
I presume that you do not expect to be able to execute an encrypted script?
â Andy Dalton
May 8 at 17:07
1
Define 'breaking'.
â DopeGhoti
May 8 at 17:08
7
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing bash -x <script.sh>. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
â Rob
May 8 at 17:27
 |Â
show 4 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have a shell script I want to encrypt in order to hide my code.
Please do not suggest SHC, because it is breaking (editor's note: explanation needed).
shell-script encryption
I have a shell script I want to encrypt in order to hide my code.
Please do not suggest SHC, because it is breaking (editor's note: explanation needed).
shell-script encryption
edited May 8 at 18:11
Vlastimil
6,3011146116
6,3011146116
asked May 8 at 16:49
MeMaTi
22
22
closed as unclear what you're asking by Rui F Ribeiro, Romeo Ninov, Vlastimil, Jeff Schaller, Michael Homer May 8 at 20:16
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Rui F Ribeiro, Romeo Ninov, Vlastimil, Jeff Schaller, Michael Homer May 8 at 20:16
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Is there a reason simply using GPG is insufficient? You can encrypt any file, not just scripts, using the method outlined here: gnupg.org/gph/en/manual/x110.html
â John Moon
May 8 at 16:57
can it break script ?
â MeMaTi
May 8 at 16:59
3
I presume that you do not expect to be able to execute an encrypted script?
â Andy Dalton
May 8 at 17:07
1
Define 'breaking'.
â DopeGhoti
May 8 at 17:08
7
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing bash -x <script.sh>. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
â Rob
May 8 at 17:27
 |Â
show 4 more comments
Is there a reason simply using GPG is insufficient? You can encrypt any file, not just scripts, using the method outlined here: gnupg.org/gph/en/manual/x110.html
â John Moon
May 8 at 16:57
can it break script ?
â MeMaTi
May 8 at 16:59
3
I presume that you do not expect to be able to execute an encrypted script?
â Andy Dalton
May 8 at 17:07
1
Define 'breaking'.
â DopeGhoti
May 8 at 17:08
7
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing bash -x <script.sh>. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
â Rob
May 8 at 17:27
Is there a reason simply using GPG is insufficient? You can encrypt any file, not just scripts, using the method outlined here: gnupg.org/gph/en/manual/x110.html
â John Moon
May 8 at 16:57
Is there a reason simply using GPG is insufficient? You can encrypt any file, not just scripts, using the method outlined here: gnupg.org/gph/en/manual/x110.html
â John Moon
May 8 at 16:57
can it break script ?
â MeMaTi
May 8 at 16:59
can it break script ?
â MeMaTi
May 8 at 16:59
3
3
I presume that you do not expect to be able to execute an encrypted script?
â Andy Dalton
May 8 at 17:07
I presume that you do not expect to be able to execute an encrypted script?
â Andy Dalton
May 8 at 17:07
1
1
Define 'breaking'.
â DopeGhoti
May 8 at 17:08
Define 'breaking'.
â DopeGhoti
May 8 at 17:08
7
7
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing bash -x <script.sh>. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
â Rob
May 8 at 17:27
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing bash -x <script.sh>. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
â Rob
May 8 at 17:27
 |Â
show 4 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
I want to hide my code.
Well, ... this smells, no offence. Why do you want to hide your code is a mystery to me.
Anyway, to answer your question:
How to encrypt a shell (bash) script?
You probably wish to achieve the impossible task as was poked by Rob in his comment, I will borrow it as it stands, because from my standpoint it is sufficient:
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing
bash -x <script.sh>
. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
I would only add, there is one method I know of, which you for some reason call breaking, which without knowledge of your code is impossible to establish as to why, so I will not even bring it up.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I want to hide my code.
Well, ... this smells, no offence. Why do you want to hide your code is a mystery to me.
Anyway, to answer your question:
How to encrypt a shell (bash) script?
You probably wish to achieve the impossible task as was poked by Rob in his comment, I will borrow it as it stands, because from my standpoint it is sufficient:
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing
bash -x <script.sh>
. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
I would only add, there is one method I know of, which you for some reason call breaking, which without knowledge of your code is impossible to establish as to why, so I will not even bring it up.
add a comment |Â
up vote
1
down vote
I want to hide my code.
Well, ... this smells, no offence. Why do you want to hide your code is a mystery to me.
Anyway, to answer your question:
How to encrypt a shell (bash) script?
You probably wish to achieve the impossible task as was poked by Rob in his comment, I will borrow it as it stands, because from my standpoint it is sufficient:
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing
bash -x <script.sh>
. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
I would only add, there is one method I know of, which you for some reason call breaking, which without knowledge of your code is impossible to establish as to why, so I will not even bring it up.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I want to hide my code.
Well, ... this smells, no offence. Why do you want to hide your code is a mystery to me.
Anyway, to answer your question:
How to encrypt a shell (bash) script?
You probably wish to achieve the impossible task as was poked by Rob in his comment, I will borrow it as it stands, because from my standpoint it is sufficient:
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing
bash -x <script.sh>
. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
I would only add, there is one method I know of, which you for some reason call breaking, which without knowledge of your code is impossible to establish as to why, so I will not even bring it up.
I want to hide my code.
Well, ... this smells, no offence. Why do you want to hide your code is a mystery to me.
Anyway, to answer your question:
How to encrypt a shell (bash) script?
You probably wish to achieve the impossible task as was poked by Rob in his comment, I will borrow it as it stands, because from my standpoint it is sufficient:
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing
bash -x <script.sh>
. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
I would only add, there is one method I know of, which you for some reason call breaking, which without knowledge of your code is impossible to establish as to why, so I will not even bring it up.
edited May 9 at 5:13
answered May 8 at 18:02
Vlastimil
6,3011146116
6,3011146116
add a comment |Â
add a comment |Â
Is there a reason simply using GPG is insufficient? You can encrypt any file, not just scripts, using the method outlined here: gnupg.org/gph/en/manual/x110.html
â John Moon
May 8 at 16:57
can it break script ?
â MeMaTi
May 8 at 16:59
3
I presume that you do not expect to be able to execute an encrypted script?
â Andy Dalton
May 8 at 17:07
1
Define 'breaking'.
â DopeGhoti
May 8 at 17:08
7
Sorry @MeMaTi what you are asking is not possible. A Bash script is a plain text list of commands, that need to be clear so they can be interpreted. Even if for some reason you can encrypt it in at rest file, I could easily see what your code was by doing bash -x <script.sh>. That will output every command the script is about to execute before executing it, this is very useful for debugging scripts.
â Rob
May 8 at 17:27