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

shell script for string encryption

Reply to Message Icon

Original Message
Name: caliente
Date: May 10, 2006 at 15:58:42 Pacific
Subject: shell script for string encryption
OS: WinXP
CPU/Ram: 2000MHZ/512 MB
Model/Manufacturer: 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


Report Offensive Message For Removal


Response Number 1
Name: ghostdog
Date: May 12, 2006 at 23:07:03 Pacific
Subject: shell script for string encryption
Reply: (edit)

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


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: shell script for string encryption

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge