Shell script for encrypting a string


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script for encrypting a string
# 1  
Old 04-14-2010
Shell script for encrypting a string

Hi,
I am new to Unix server and shell scripting.I want to encrypt username/password using shell script.I know that there's a Crypt command to encrypt but it is not installed in my unix server and cannot be installed due to some reason.So i want the shell script of the crypt command or is there any other way to do encryption?

Thanks in advance.
# 2  
Old 04-14-2010
There really is no shell script of the crypt command. It is a C program.

You do understand that the encryption for passwords is one way. And not all systems use crypt they may use md5 or SHA1 or some other hash routine.

Maybe if you tell us what you need, rather than how you think you should do it, we could give you contructive help.
# 3  
Old 04-15-2010
Shell script for encrypting a string

I just want to write a shell script for encrypting username/password and another script for decrypting it.
# 4  
Old 04-15-2010
I have a funny feeling this is a home work.
Still. May be this might be good to get started.
Code:
tr '[a-z]' 'qweasdzxcrfvbgtyhnmjuiklop' file

May need to add Upper chars, numbers, and the sink.
But you get the idea.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issues Masking(Encrypting) a string

Hi, echo "mypassword" | crypt "tom" But this is giving me some unreadable strange looking characters / symbols never seen before which I cant even copy and save in a file. SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v Can you help me with encrypting the password "mypassword" in... (15 Replies)
Discussion started by: mohtashims
15 Replies

2. Shell Programming and Scripting

Shell Script for encrypting/decrypting text file

Hello, I am a newbie in Shell scripting. At the moment, I have a program written in C++ which gives an output file in text format. I would like to write a shell program which can take that output file and encrypt it and later if needed I want to decrypt it. Could someone please help or... (3 Replies)
Discussion started by: Tanin
3 Replies

3. Shell Programming and Scripting

How to get the last value from a string in shell script?

I have to get the last value from a string, below is the example string String -> Here is the test string 12233 O/P -> 12233 String -> Hello world 500 O/P -> 500 String -> 300 O/P -> 300 Please help (2 Replies)
Discussion started by: vel4ever
2 Replies

4. UNIX for Dummies Questions & Answers

Comparing a String variable with a string literal in a Debian shell script

Hi All, I am trying to to compare a string variable with a string literal inside a loop but keep getting the ./testifstructure.sh: line 6: #!/bin/sh BOOK_LIST="BOOK1 BOOK2" for BOOK in ${BOOK_LIST} do if then echo '1' else echo '2' fi done Please use next... (1 Reply)
Discussion started by: daveu7
1 Replies

5. Shell Programming and Scripting

Shell Script [Replacing string]

My friend and I are working on a project together and we are trying to create a shell script that renames, replaces a string in a text file. The newly created file with the substitution would replace the name of the original file. And the original file would be saved as "____.txt.bak" This is... (6 Replies)
Discussion started by: jzhang172
6 Replies

6. Shell Programming and Scripting

Encrypting bash script

I used shc for encrypting a bash script. It worked fine, but the issue is that, when I run the script using ./test.sh.x in a screen and after getting out of the screen when I type "ps aux" I can see the source code from the command prompt and also the commands being executed as plain text. See... (1 Reply)
Discussion started by: anilcliff
1 Replies

7. Shell Programming and Scripting

Encrypting a shell script

Hi all, I have one script with me , say automate.sh. I would like to encrypt it, so that no one can see the contents of this script. Can anyone guide me to encrypt/decrypt this script? Regards, akash (1 Reply)
Discussion started by: akash_mahakode
1 Replies

8. Solaris

Encrypting a script......

Hiiiiii..... every one..... I have written a script, and i want to make that script confidential.So that, only i can see that script. I am using " crypt " command in solaris 9, to encrypt that script.But when i am executing this... (6 Replies)
Discussion started by: prashantshukla
6 Replies

9. UNIX for Dummies Questions & Answers

masking or encrypting in shell script

Hi folks, I am writing a script which asks the user to enter a user name and password to telnet and logon to some other machine. The script promts the user to enter the login name and password as below. echo "Enter the login name to be used to login on the machine" read login echo "Enter the... (4 Replies)
Discussion started by: dshrish
4 Replies

10. Shell Programming and Scripting

Encrypting a password for shell script

All, I want to encrypt a database system administration password into a file or environment variable. Then, I want to decrypt the password from the file or environment variable so nobody sees the clear text password. For example, I have the database password of developement. I need to... (1 Reply)
Discussion started by: bubba112557
1 Replies
Login or Register to Ask a Question