Results 1 to 11 of 11
Thread: shell script encrypt
-
05-30-2004, 06:20 PM #1Web Hosting Master
- Join Date
- Dec 2002
- Posts
- 1,304
shell script encrypt
Hi,
I am looking for a way to either encrypt / obfuscate a string using a bash shell script.
The catch is...
It cant be a one-way hash. Md5, etc wont work because it needs to be reversible, preferably with a key.
I found some cheesey ROT13 routine.. I would like to make it a little more interesting than that.
This is just for some little project - it doesnt have to be overly secure.
Any ideas?"The only difference between a poor person and a rich person is what they do in their spare time."
"If youth is wasted on the young, then retirement is wasted on the old"
-
05-31-2004, 03:19 AM #2Retired Moderator
- Join Date
- Jul 2002
- Location
- Kuwait
- Posts
- 10,620
shell script compiler
converts ur script into c source then compile it, i use it all the time amazingBashar Al-Abdulhadi - KuwaitNET Internet Services Serving customers since 1997
Kuwait's First Webhosting and Domain Registration provider - an ICANN Accredited Registrar
Twitter: Bashar Al-Abdulhadi
-
05-31-2004, 03:46 AM #3Web Hosting Master
- Join Date
- Dec 2002
- Posts
- 1,304
I think you misunderstood me.
I dont want to encrypt the entire script.
I want to operate on a string, using a bash shell script.
POssible?"The only difference between a poor person and a rich person is what they do in their spare time."
"If youth is wasted on the young, then retirement is wasted on the old"
-
05-31-2004, 07:05 AM #4Retired Moderator
- Join Date
- Jul 2002
- Location
- Kuwait
- Posts
- 10,620
ah use the command enigma (on freebsd) not sure if its there by default on linux
ested by:
Code:#!/usr/local/bin/bash read -p "enter a command " ecmd read -p "enter key " ekey echo $ecmd |enigma $ekey > /tmp/.ecmd read -p " what is the key? " ekeys enigma $ekeys < /tmp/.ecmd
# file /tmp/.ecmd
/tmp/.ecmd: dataBashar Al-Abdulhadi - KuwaitNET Internet Services Serving customers since 1997
Kuwait's First Webhosting and Domain Registration provider - an ICANN Accredited Registrar
Twitter: Bashar Al-Abdulhadi
-
05-31-2004, 09:34 AM #5Web Hosting Guru
- Join Date
- Apr 2002
- Location
- Troy, MI
- Posts
- 324
hmm cant seem to get shc to work; compile a script with it and execute the generated binary and it just sits there; have to kill it.
Ryan MacDonald
Lead Administrator | TotalChoice Hosting
Choice Does Matter! | Serving over 26,000 clients
-
05-31-2004, 10:25 AM #6Web Hosting Master
- Join Date
- Feb 2004
- Posts
- 1,269
seriously, if you want to "compile" a shell script, that's probably because you want to distribute that...
and if you need to do that, i would HIGH suggest that you write it in C from the start... no "language X to language Y" conversor is good even more those to convert from a language like shell that you don't even need to declare variables and types to one that you need
-
05-31-2004, 03:10 PM #7Originally posted by Lem0nHead
I would HIGH suggest that you write it in C from the start...Tom Whiting, WHMCS Guru extraordinaire
Linux problems? WHMCS Problems? Give me a shout
Check out my WHMCS Addons
-
05-31-2004, 04:48 PM #8Web Hosting Guru
- Join Date
- Apr 2002
- Location
- Troy, MI
- Posts
- 324
Im just toying with shc; i know the pro's and con's of application development be it a small script or a bloated application; in C.
Just curious if anyone has gotten shc to work properly.Ryan MacDonald
Lead Administrator | TotalChoice Hosting
Choice Does Matter! | Serving over 26,000 clients
-
05-31-2004, 07:23 PM #9Web Hosting Master
- Join Date
- Dec 2002
- Posts
- 1,304
Works fine for me.
RH9 / FC1.
I dont use any special flags.
Hell, it even works for me under Cygwin> I can compile SHC from source, use it, and the binaries work."The only difference between a poor person and a rich person is what they do in their spare time."
"If youth is wasted on the young, then retirement is wasted on the old"
-
05-31-2004, 07:35 PM #10Web Hosting Guru
- Join Date
- Apr 2002
- Location
- Troy, MI
- Posts
- 324
Hmm ya it only not working on my hardened grsec/gradm systems; dont see pax terminations or grsec logging events -- o well.
Ryan MacDonald
Lead Administrator | TotalChoice Hosting
Choice Does Matter! | Serving over 26,000 clients
-
06-01-2004, 04:02 AM #11Retired Moderator
- Join Date
- Jul 2002
- Location
- Kuwait
- Posts
- 10,620
Originally posted by wolfstream
Agreed, you can even use the system() call in C to get your shell script compiled. It's cheap I know, but it works. I actually use C to manage and maintain 90% of my scripts. The only ones I don't are the more complicated ones which will take a little more tweaking to move to CBashar Al-Abdulhadi - KuwaitNET Internet Services Serving customers since 1997
Kuwait's First Webhosting and Domain Registration provider - an ICANN Accredited Registrar
Twitter: Bashar Al-Abdulhadi