<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Scritping in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446823#M9592</link>
    <description>I have scripted a password retrieval utility.  I need the passwords to be encrypted; this I have achieved by storing them in a file accessible using "vi -x &lt;FILENAME&gt;".  My problem is that of opening the file so it is readable grepping for the password field displaying that password and then closing it.  I have tried copying to an interim file via &lt;BR /&gt;&lt;BR /&gt;echo ZZ | vi -x wpass &amp;gt; wpasstemp&lt;BR /&gt;&lt;BR /&gt;but this then throws me out of my script after I have typed in the decryption key.  Is there a better way of doing this whilst maintaining the integrity of the password file via encryption.  I would intend to remove the wpasstemp file immediately. &lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/FILENAME&gt;</description>
    <pubDate>Wed, 20 Sep 2000 18:02:05 GMT</pubDate>
    <dc:creator>Louis Mushandu</dc:creator>
    <dc:date>2000-09-20T18:02:05Z</dc:date>
    <item>
      <title>Scritping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446823#M9592</link>
      <description>I have scripted a password retrieval utility.  I need the passwords to be encrypted; this I have achieved by storing them in a file accessible using "vi -x &lt;FILENAME&gt;".  My problem is that of opening the file so it is readable grepping for the password field displaying that password and then closing it.  I have tried copying to an interim file via &lt;BR /&gt;&lt;BR /&gt;echo ZZ | vi -x wpass &amp;gt; wpasstemp&lt;BR /&gt;&lt;BR /&gt;but this then throws me out of my script after I have typed in the decryption key.  Is there a better way of doing this whilst maintaining the integrity of the password file via encryption.  I would intend to remove the wpasstemp file immediately. &lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/FILENAME&gt;</description>
      <pubDate>Wed, 20 Sep 2000 18:02:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446823#M9592</guid>
      <dc:creator>Louis Mushandu</dc:creator>
      <dc:date>2000-09-20T18:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Scritping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446824#M9593</link>
      <description>Look into using the crypt command as opposed to using vi for encryption.  Do am man on crypt.  You should be able to achive what you're looking for.</description>
      <pubDate>Wed, 20 Sep 2000 18:10:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446824#M9593</guid>
      <dc:creator>Tom Danzig</dc:creator>
      <dc:date>2000-09-20T18:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: Scritping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446825#M9594</link>
      <description>vi -x uses the crypt() library.&lt;BR /&gt;crypt is also a command, try this:&lt;BR /&gt;&lt;BR /&gt;crypt PASSWORD &amp;lt; filename | grep ...&lt;BR /&gt;&lt;BR /&gt;Note: the PASSWORD will show up in the process list in that brief execution time.</description>
      <pubDate>Wed, 20 Sep 2000 18:11:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446825#M9594</guid>
      <dc:creator>Dan Garthwaite</dc:creator>
      <dc:date>2000-09-20T18:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Scritping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446826#M9595</link>
      <description>Louis:&lt;BR /&gt;&lt;BR /&gt;A very recent thread may be of interest to you on this:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x66ec6c96588ad4118fef0090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x66ec6c96588ad4118fef0090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 20 Sep 2000 18:30:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446826#M9595</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-09-20T18:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scritping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446827#M9596</link>
      <description>Here is a C program to do the encryption&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main (void)&lt;BR /&gt;{&lt;BR /&gt;    int result;&lt;BR /&gt;    result=check_pass("password","24489");&lt;BR /&gt;    printf ("%d",result);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;int check_pass(const char *plainpw, const char *cryptpw)&lt;BR /&gt;{&lt;BR /&gt; printf ("%sn",crypt(plainpw,cryptpw)); &lt;BR /&gt; return strcmp(crypt(plainpw,cryptpw), cryptpw) == 0;&lt;BR /&gt;}&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Wed, 20 Sep 2000 19:15:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446827#M9596</guid>
      <dc:creator>Anthony Goonetilleke</dc:creator>
      <dc:date>2000-09-20T19:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Scritping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446828#M9597</link>
      <description>Also a perl program that does a similar thing... (watch out for that seed)&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/perl &lt;BR /&gt;# Usage: &lt;BR /&gt;# &lt;BR /&gt;# enc_passwd _plaintxt_ [ _salt_ ] &lt;BR /&gt;# &lt;BR /&gt;# When trying to compare a plaintext password to an already-existing &lt;BR /&gt;# encrypted password, use the first two characters of the encrypted &lt;BR /&gt;# password as the salt. If you are generating a new encrypted password, &lt;BR /&gt;# omit the second argument and the script will generate a random salt. &lt;BR /&gt;# &lt;BR /&gt;# Note: only the first 8 characters of the plaintext and the first 2 &lt;BR /&gt;# characters of the salt are significant. Extra characters are silently &lt;BR /&gt;# ignored. &lt;BR /&gt;# &lt;BR /&gt;     srand(time);&lt;BR /&gt; if&lt;BR /&gt;     (scalar(@ARGV) == 0) { die "Usage:n enc_passwd _plaintxt_ [ _salt_ ]n"; }&lt;BR /&gt;     $plaintext=$ARGV[0];&lt;BR /&gt;     $alphabet="./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&lt;BR /&gt;";&lt;BR /&gt;     if (length($ARGV[1]) &amp;gt;= 2) { $salt=$ARGV[1]; } else { substr($salt, 0, 1)=s&lt;BR /&gt;ubstr($alphabet,rand(63), 1); substr($salt, 1, 1)=substr($alphabet, rand(63), 1); } $cipher&lt;BR /&gt;text=crypt($plaintext,$salt); print $ciphertext, "n";&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Sep 2000 19:18:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scritping/m-p/2446828#M9597</guid>
      <dc:creator>Anthony Goonetilleke</dc:creator>
      <dc:date>2000-09-20T19:18:29Z</dc:date>
    </item>
  </channel>
</rss>

