Computing.Net > Forums > Unix > shell script for string encryption

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

shell script for string encryption

Reply to Message Icon

Name: caliente
Date: May 10, 2006 at 15:58:42 Pacific
OS: WinXP
CPU/Ram: 2000MHZ/512 MB
Product: Dell
Comment:

Hi. I am a beginner on scripting.

I will write a shell script for string encryption/decryption. the script will take 3 parameters. First one will be a flag telling whether to do encryption or decryption. Second parameter will be an integer of unknown size (password). Third parameter will be the string to encrypt/decrypt. The output of the script will be just the encrypted/decrypted string. It should work as below:

#> 240702099_sh2b.sh –e 2967 “this is the string to encrypt” erh,sas1:?wqe!@ zxdcdo? ddsaa
#> 240702099_sh2b.sh –d 2967 “erh,sas1:?wqe!@ zxdcdo? ddsaa” this is the string to encrypt

I need to create an array like this:

letter_list=”abcdefghijklmnopqrstuvwyz!?,. ><+-:;”
For encryption, the idea is to take a letter from the input string, find its index in the letter_list (call it cind). then take the current digit of the password, add this value to the cind and exchange the current letter in the string with the character at index cind from the letter_list. If After the summation, cind becomes more than the size of the letter_list, the circle to the other end of the array. Then it will skip to the next letter in the string and next digit in the password. If it exceeds the boundaries of password, it will start from the beginning of it.
For encryption i need to use the circle manner also.

Can anybody hepl me please? Sorry for the long message



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: May 12, 2006 at 23:07:03 Pacific
Reply:

try using other programming languages like Perl that have encryption modules to do your job.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: shell script for string encryption

shell script for string search www.computing.net/answers/unix/shell-script-for-string-search/5478.html

shell script for sent e-mail www.computing.net/answers/unix/shell-script-for-sent-email/5000.html

Shell script encryption www.computing.net/answers/unix/shell-script-encryption/7475.html