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
pgp encryption Arvind Maurya UNIX for Advanced & Expert Users 0 04-13-2007 07:48 AM
File encryption/Key encryption ???? hugow UNIX for Dummies Questions & Answers 1 03-18-2006 04:29 PM
128 bit encryption vicious3126 Security 3 08-30-2002 10:17 PM
MD5 to DES encryption Larsonist Security 1 06-14-2002 04:50 PM
DES Encryption Maestin High Level Programming 4 05-29-2002 03:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-10-2002
trynew trynew is offline
Registered User
  
 

Join Date: Jun 2002
Posts: 50
encryption is possible??

NEED expertise help for this topic!!!


Question 1: Is encryption possible for the shell scriping programing? shadow the scriping file, do think is impossible...

Question2: built a simple program with the simplicity function that allow user change settings by enter corret name and password combination, how to prevent the password not being seen by others just open up the scriping file?

Question 3: is possible to retrieval data from a encryped file? if can, how?

any comment are all welcome, Thanks in advance!!!

trynew
  #2 (permalink)  
Old 07-10-2002
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
You can use encryption in a script but what are you using to write this in? If you are looking to do something with the password and/or shadow file, using Perl may be the way to go (at least for the call to the password/shadow file).

Unsure what you mean by "shadow the scripting file".

Question 2: What are you using - is this a web interface? Or just a script that normal users can run to change something (what?).

To prevent password from being seen:
from a web page: set input type to password
<input type="password" name="newpass" size=15>
For a terminal: stty -echo turns off echo, stty echo turns it back on. Check the man page for stty.

Q3: Yes, if you encrypt a file you can still retrieve data but you have to unencrypt it in the case of pgp. If you are talking about retrieve what a password is - not exactly. You can find out if a unencrypted password matches with the following - but you don't really unencrypt the password - you compare by encrypting.

Perl script to check a password - supply userid and password

#!/u/bin/perl
#
# Grab the user's old password from /etc/shadow and compare to sent
# old password from web page - send back error if not the same
#
=======================================
$user = "$ARGV[0]";
$oldpass = "$ARGV[1]";
$datenow = "`date '+%h %d %T'`";
#
$userinfo = `/usr/bin/grep $user /etc/shadow`;
($user1, $passwd1, $passextra) = split(/:/, $userinfo, 3);
$salt = substr($passwd1,0,2);
#
if (crypt($oldpass, $salt) ne $passwd1) {
die "Not correct password";
}
  #3 (permalink)  
Old 08-09-2002
smokar smokar is offline
Registered User
  
 

Join Date: Aug 2002
Posts: 1
Quote:
Unsure what you mean by "shadow the scripting file".
Encrypt a shell scripting file, so nobody can see the context of file, but the scripting file still executable, anyway to do that?
  #4 (permalink)  
Old 08-09-2002
Bashar Bashar is offline
Registered User
  
 

Join Date: Aug 2001
Posts: 66
Shell Script Compiler

http://www.datsi.fi.upm.es/~frosal/
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 05:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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