Sponsored Content
Full Discussion: encryption is possible??
Top Forums Shell Programming and Scripting encryption is possible?? Post 24328 by RTM on Wednesday 10th of July 2002 09:43:12 AM
Old 07-10-2002
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";
}
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File encryption/Key encryption ????

My dilemma, I need to send, deemed confidential, information via e-mail (SMTP). This information is sitting as a file on AIX. Typically I can send this data as a e-mail attachment via what we term a "mail filter" using telnet. I now would like to somehow encrypt the data and send it to a e-mail... (1 Reply)
Discussion started by: hugow
1 Replies

2. AIX

passwords encryption

I want to store a password of a user in a encrypted format and the use that encrypted password in my shell scripting. can any one of you let me know how to do it. Thanks in advance (0 Replies)
Discussion started by: kalpana.anuga
0 Replies

3. UNIX for Advanced & Expert Users

pgp encryption

Hi I have one script for doing the gpg encryption on linux. The encrytion is doing fine when i am running the script from command prompt on linux The same script when it is triggering from mainframe using sysopts option in NDM(connect direct) the encryption step in the shell script is... (0 Replies)
Discussion started by: Arvind Maurya
0 Replies

4. UNIX for Advanced & Expert Users

Encryption Programming

I use SCO OpenServer 5 and need to add encryption capability. Is there a standard SCO package, or should I go custom, or what? (2 Replies)
Discussion started by: coreysan
2 Replies

5. Shell Programming and Scripting

Perl and encryption

Basically, I'm wondering if there's an easy way to encrypt the password to a username and store it in MySQL. But being able to authenticate to it. (3 Replies)
Discussion started by: adelsin
3 Replies

6. Shell Programming and Scripting

Password encryption...

Hi, I have a Java app that looks for some parameters in a .properties file such as username and password. However I don't want to leave the password in a text file and I can't modify the app... Does anyone have some idea about how to encrypt/hide/etc the password so it's not freely accessible... (1 Reply)
Discussion started by: Tr0cken
1 Replies

7. AIX

Encryption in AIX

Can I encrypt PDF files in AIX 5.3? (2 Replies)
Discussion started by: anthony123
2 Replies

8. Programming

3DES encryption

Hello everyone, can any one help me to find out the 3des(triple data encryption standard) algorithm implementation in C.. Thanks in advance (4 Replies)
Discussion started by: andrew.paul
4 Replies

9. Cybersecurity

File encryption tools with MAC address as an encryption key

Hi all, I'm looking for secure file encryption tools that use MAC address as encryption key. FYI, I'm using Red Hat Enterprise Linux OS. For example: when A wants to send file to B A will encrypt the file with B's computer MAC/IP address as an encryption key This file can only be decrypted... (2 Replies)
Discussion started by: sergionicosta
2 Replies
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 01:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy