The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
password in shell script rajbkriz Shell Programming and Scripting 0 01-23-2008 02:17 AM
Encrypting a script...... prashantshukla SUN Solaris 6 12-31-2007 12:53 AM
set password using a shell script tannu Shell Programming and Scripting 2 09-07-2007 01:26 AM
masking or encrypting in shell script dshrish UNIX for Dummies Questions & Answers 4 02-16-2006 01:35 AM
Encrypting password Justman AIX 6 12-16-2004 09:08 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-08-2004
bubba112557 bubba112557 is offline
Registered User
  
 

Join Date: Apr 2004
Posts: 21
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 execute the following line to access the database:

isql -Usysadmin -Pdevelopment

I want users not to see the development password in clear text.

Thanks!
  #2 (permalink)  
Old 11-08-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
One way encryption is fairly straight forward with Unix, and can be achieved using the "crypt" command (if available) or system call, or using the crypt() function in Perl, PHP and others. The problem with this is exactly that - it's one way. You can't decrypt a "crypt"ed password (otherwise /etc/{passwd,shadow} would be useless as authentication mechanisms).

The problem is that the -P option to isql expects the "true" password, not an encrypted variant. It may or may not be visible in ps output listings.

Some related threads that might assist you can be found here:
Hiding password from ps
Hiding login/password in process!

I do a lot of PHP/PostgreSQL web programming, and I request the plain text login over https, then the "login" PHP script encrypts the password and checks it against the encrypted password stored within the "user" table (or whatever it may be called). Not too sure if you could create some kind of web enabled front end for Informix - we use curses for our Informix frontend at work.

Hope something there was of use!

Cheers
ZB
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0