[29254] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 498 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 9 03:09:50 2007

Date: Sat, 9 Jun 2007 00:09:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 9 Jun 2007     Volume: 11 Number: 498

Today's topics:
    Re: a password encryption question. <wyzelli@yahoo.com>
    Re: a password encryption question.  nightcats@gmail.com
    Re: Help With Placeholders <rvtol+news@isolution.nl>
    Re: How to verify a usnername and password? <see.sig@rochester.rr.com>
        Opening a file twice and having an if loop <Slain.k@gmail.com>
    Re: Opening a file twice and having an if loop <noreply@gunnar.cc>
    Re: Querying for a registry string VALUE AutoEndTasks <shmh@bigpond.net.au>
    Re: The Concepts and Confusions of Prefix, Infix, Postf <jurgenex@hotmail.com>
    Re: The Concepts and Confusions of Prefix, Infix, Postf <twisted0n3@gmail.com>
        TITS Boobs Knockers Jugs Headlights big and small  complex.easy.n9@gmail.com
        www-search-yahoo prints no results <nospam@home.com>
    Re: Yet Another Software Challenge </dev/null@localhost.localdomain>
    Re: Yet Another Software Challenge </dev/null@localhost.localdomain>
    Re: Yet Another Software Challenge <rjh@see.sig.invalid>
    Re: Yet Another Software Challenge </dev/null@localhost.localdomain>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 09 Jun 2007 00:13:53 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: a password encryption question.
Message-Id: <5hmai.10756$wH4.2608@news-server.bigpond.net.au>

<nightcats@gmail.com> wrote in message 
news:1181320453.612263.162410@i38g2000prf.googlegroups.com...
> Hi,
>
> I have a password encryption question that really needs help.  I have
> two password-related PL files.
>
> Take an example of "test2",
> One would creat an encryption  that looking like this, "MMehO15WVVavQ"
> (Or every password with a MMxxxxxxxx pattern
>
> The other would be looking like this, "ae8FEYefjhNw2"
> Or every password with an "aexxxxx" pattern.
>
> The encryption script in the "MM" perl file is this:
>
>     $pass = crypt($password, "MM");

This is using MM as the salt to crypt.

> The encryption in the second perl (the 'ae' thing) is this:
>
>       $test_passwd = crypt($FORM{'password'}, substr($passwd, 0, 2));

This is using the first two characters of $passwd as the salt to crypt.

> ------------
>
> My question is,  how could I make them created the same version of
> encryption, so that the two files can share one set of password?

Make them both do the same thing...

$pass = crypt($password,  substr($passwd, 0, 2));

$test_passwd = crypt($FORM{'password'}, substr($passwd, 0, 2));

Read up on the crypt function, perldoc -f crypt

The substr($passwd, 0, 2) portion is taking the first 2 character of the 
variable $passwd and using that as the 'salt' to the crypt function.

So for the above to work you need to know what is in the $passwd variable in 
the second script, and make sure that is available the same in the first 
program.

Another way would be

$pass = crypt($password, "MM");

$test_passwd = crypt($FORM{'password'}, 'MM');

Though using the same salt for all passwords is a huge security hole.

The docs for the crypt function give some advise about selecting a good 
salt.

P 



------------------------------

Date: Fri, 08 Jun 2007 22:13:33 -0700
From:  nightcats@gmail.com
Subject: Re: a password encryption question.
Message-Id: <1181366013.071187.284770@o11g2000prd.googlegroups.com>

On 6 9 ,   8 13 , "Peter Wyzl" <wyze...@yahoo.com> wrote:
> <nightc...@gmail.com> wrote in message
>
> news:1181320453.612263.162410@i38g2000prf.googlegroups.com...
>
> > Hi,
>
> > I have a password encryption question that really needs help.  I have
> > two password-related PL files.
>
> > Take an example of "test2",
> > One would creat an encryption  that looking like this, "MMehO15WVVavQ"
> > (Or every password with a MMxxxxxxxx pattern
>
> > The other would be looking like this, "ae8FEYefjhNw2"
> > Or every password with an "aexxxxx" pattern.
>
> > The encryption script in the "MM" perl file is this:
>
> >     $pass = crypt($password, "MM");
>
> This is using MM as the salt to crypt.
>
> > The encryption in the second perl (the 'ae' thing) is this:
>
> >       $test_passwd = crypt($FORM{'password'}, substr($passwd, 0, 2));
>
> This is using the first two characters of $passwd as the salt to crypt.
>
> > ------------
>
> > My question is,  how could I make them created the same version of
> > encryption, so that the two files can share one set of password?
>
> Make them both do the same thing...
>
> $pass = crypt($password,  substr($passwd, 0, 2));
>
> $test_passwd = crypt($FORM{'password'}, substr($passwd, 0, 2));
>
> Read up on the crypt function, perldoc -f crypt
>
> The substr($passwd, 0, 2) portion is taking the first 2 character of the
> variable $passwd and using that as the 'salt' to the crypt function.
>
> So for the above to work you need to know what is in the $passwd variable in
> the second script, and make sure that is available the same in the first
> program.
>
> Another way would be
>
> $pass = crypt($password, "MM");
>
> $test_passwd = crypt($FORM{'password'}, 'MM');
>
> Though using the same salt for all passwords is a huge security hole.
>
> The docs for the crypt function give some advise about selecting a good
> salt.
>
> P

Thank you guys for advising.

I decide to change the Salt into random form for security sake.

I made the first script:

       $pass = crypt($password, "MM");

change to this:

       $pass = crypt($password, substr($password, 0, 2));

However, the first two letters of the encrypted password stays the way
they are.

like, "test1" becomes "teXXXXX", and "wxyz" becomes "wxXXXXX".  Only
the letters behind the first two are crypted.  Did I do anything
wrong?

Thanks.



------------------------------

Date: Sat, 9 Jun 2007 07:03:03 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Help With Placeholders
Message-Id: <f4djkk.os.1@news.isolution.nl>

Lars Haugseth schreef:
> Bart Lateur:
>> PerlGoon:

>>> Instead I was looking for something already built into DBI that
>>> would maybe return the last executed query... or something built
>>> into MySQL that would log specific queries.
>> 
>> Set DBI trace?
>> http://search.cpan.org/perldoc?DBI#TRACING
> 
> Unfortunately not.
> 
> Quote from the "Trace Flags" subsection:
> "SQL - trace SQL statements executed (not yet implemented)"

That is about "Trace Flags". 

For me, this just works: $dbh->trace(1). 
See also "RaiseError". 

-- 
Affijn, Ruud

"Gewoon is een tijger."


------------------------------

Date: Fri, 08 Jun 2007 23:32:28 -0400
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: How to verify a usnername and password?
Message-Id: <466a1f4d$0$30678$4c368faf@roadrunner.com>

nightcats@gmail.com wrote:
>> Depending upon your software, you may need to lock access to the
>> password file so multiple instances of your program can't access it
>> simultaneously, at least not when one or more instances need to write to
>> it.  See:
>>
>>    perldoc -q lock
>>
> 
> 
> By the way, I'll decide the passwoard for everybody (which is about 40
> of them).  They just have to use the password I choose. There is no
> written job for visitors.  so, do I still need to do this? thanks.
> 
> (I know thess questions could look stupid..........)
> 

To the best of my knowledge, if you are only reading a file, there is no 
need to lock access to it from CGI scripts.

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


------------------------------

Date: Sat, 09 Jun 2007 02:23:21 -0000
From:  Slain <Slain.k@gmail.com>
Subject: Opening a file twice and having an if loop
Message-Id: <1181355801.468064.61750@n4g2000hsb.googlegroups.com>

I am writing this perl script, whose aim is to run through a file,
look for a particular string, if found, store it in a variable -
$str1. And then replace another string -  $Str2 with the string $Str1.

In a previous version of the script, I was just swapping out one text
for another and it worked fine. If it found it swapped it, else it
just closed the file.

With the addition done, to look for a particular string first and then
swap if needed, the script kind of gets messed up, when the text I am
looking for is not present in the file. Since I am using this script
to run through multiple files, there will be files without the string
I am looking for in which case I do not want it to do anything. Can
some one tell me what mistake I am making in the script below?

Thanks

foreach $filename (@filelist) {

	print "    P: $filename\n";
	$filename1 = $filename;

	open (file, "$filename1") || die("Error Reading File: $filename $!");
	{
	my $target = "<title>";
	while(<file>)
	{
	 my($line) = $_;
	 chomp($line);
	#print "the target is $target \n";
	 	if(/$target/) {
			print "found target on line $. \n";
			($a,$b,$c)=split(/</,$line);
			($d,$e)	= split(/>/,$b);
			@find3= "Generic_Text";
	 		@replace3 = "$e";
		#$replace3 = "media module";
		print "the three splits are $a, $b, $c \n";
		print "the  splits are $d, $e \n";

	                }
 		}
	}
	close (file)|| die("Error Closing File: $filename $!");

	# retrieve complete file
    open (IN, "$filename") || die("Error Reading File: $filename $!");
	{
		undef $/;
		$infile = <IN>;

	}
    close (IN) || die("Error Closing File: $filename $!");

	$infile =~ s/@find3/@replace3/g;


	# write complete file
     open (PROD, ">$filename") || die("Error Writing to File:
$filename $!");
	 print PROD $infile;
     close (PROD) || die("Error Closing File: $filename $!");
     }
   print "\nFinished.\n";


   exit(0);



------------------------------

Date: Sat, 09 Jun 2007 06:12:58 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Opening a file twice and having an if loop
Message-Id: <5cunreF32kdg2U1@mid.individual.net>

Slain wrote:
> With the addition done, to look for a particular string first and then
> swap if needed, the script kind of gets messed up, when the text I am
> looking for is not present in the file.

What does it mean when you say that "the script kind of gets messed up"?

> Can some one tell me what mistake I am making in the script below?

There is a lot to say about your script, but since you chose to post 
here, what comes to mind first is to call your attention to the posting 
guidelines for this Usenet group:

http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

Please study and follow those guidelines, and if doing so doesn't help 
you solve the problem, post here in accordance with the guidelines.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Sat, 09 Jun 2007 02:09:54 GMT
From: "SimonH" <shmh@bigpond.net.au>
Subject: Re: Querying for a registry string VALUE AutoEndTasks
Message-Id: <SZnai.10801$wH4.1819@news-server.bigpond.net.au>

Hi Petr!

Its a created string value for forcing applications that wont close to 
close.


"Petr Vileta" <stoupa@practisoft.cz> wrote in message 
news:f4ago0$2vn3$1@ns.felk.cvut.cz...
> SimonH wrote:
>> Hi guys would love your help.
>>
>> I have the following....
>>
>> =================================================================
>> #use Win32::Process;
>> use Win32::Registry;
>
> Please for  what is the "AutoEndTasks" registry key mean?
> -- 
>
> Petr Vileta, Czech republic
> (My server rejects all messages from Yahoo and Hotmail. Send me your mail 
> from another non-spammer site please.)
>
>
> 




------------------------------

Date: Fri, 08 Jun 2007 23:30:24 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations
Message-Id: <kElai.242$c45.160@trndny06>

xahlee@gmail.com wrote:
[nothing relevant to Perl]

Oh no, it is back.
Did your ISP finally cancel your old account or why are you switching to a 
new address?
Don't try to disguise yourself. Your 'contributions' can easily be 
identified no matter what pseudonym you are using.

***PLONK AGAIN***

jue 




------------------------------

Date: Sat, 09 Jun 2007 03:10:16 -0000
From:  Twisted <twisted0n3@gmail.com>
Subject: Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations
Message-Id: <1181358616.792797.97720@k79g2000hse.googlegroups.com>

On Jun 8, 7:30 pm, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> xah...@gmail.com wrote:
>
> [nothing relevant to Perl]

Perl?? Perl is even less relevant to Java than the original post,
which admittedly has some connection to pretty much all programming
languages. (Perl, on the other hand, has no connection to any known
programming language. ;) In particular, Perl code looks more like line
noise than like code from any known programming language. ;))



------------------------------

Date: Fri, 08 Jun 2007 16:53:40 -0700
From:  complex.easy.n9@gmail.com
Subject: TITS Boobs Knockers Jugs Headlights big and small
Message-Id: <1181346820.041423.166470@m36g2000hse.googlegroups.com>

http://www.tits.sc/ The Best Resource for Tits on the Net. Hi there
everyone, Darrelt D. Sanchez here CEO of http://www.tits.sc/ Double D
for short here to present are new website.  There are two types of us
guys in the world. Guys who love big tits, guys who love small tits
their is no middle ground.  I love both. Well I created this site
because I am the kind of guy who loves both. This is the newest series
of fresh content that I am actively shooting as you read this. I am
travelling the world looking for the Hottest tits you can find and
presenting them to you. Hope you enjoy. What's up Fellas!!!... This
week I  met with my old friend http://www.tits.sc/MistiLove. She
picked me up in her Limousine and you have to check her out, her Big
titties are fucking amazing. We went around the city looking for dudes
so she can fuck them hard. During the trip she show me her tits and
her round and sweet ass. We couldn't find any guy so we went to my
house where my roommate Julius was waiting for me. When we got there
naked, she went right on top of him, he touches, squeeze, and suck her
tits. Then he take out his clothes and fuck her really hard. He fuck
her many times in different positions. Then he fuck her titties and
came on top of them. If you can call yourself a tittie fanatic, you
can't miss Misti love Big Round Titties.



------------------------------

Date: Sat, 09 Jun 2007 02:10:50 GMT
From: "Nospam" <nospam@home.com>
Subject: www-search-yahoo prints no results
Message-Id: <K_nai.7832$E9.7528@newsfe6-gui.ntli.net>

I am wondering why this doesn't print any search results, all it does is
print www::search::yahoo

#! usr/bin/perl

use strict;
use warnings;
use WWW::Search;


my $oSearch = new WWW::Search('Yahoo::UK');





my $sQuery = WWW::Search::escape_query("spiderman 3 news");

$oSearch->native_query($sQuery);

while ( my $oResult = $oSearch->next_result() ) {

    print "Adding: ", $oResult->url, "\n";

    }
print ref($oSearch);




------------------------------

Date: Sat, 09 Jun 2007 01:32:42 +0200
From: =?ISO-8859-1?Q?Grzegorz_Wr=F3bel?= </dev/null@localhost.localdomain>
Subject: Re: Yet Another Software Challenge
Message-Id: <f4co68$7li$1@atlantis.news.tpi.pl>

Joe Smith wrote:
> Grzegorz Wróbel wrote:
> 
>> Not really. The line contains 114024 characters and it is impossible 
>> to select it in the Firefox's source viewer.
> 
> It's more convenient to save it to a file and work from there.
> 

You mean that's the only way that works with Firefox.

-- 
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D


------------------------------

Date: Sat, 09 Jun 2007 01:33:00 +0200
From: =?ISO-8859-1?Q?Grzegorz_Wr=F3bel?= </dev/null@localhost.localdomain>
Subject: Re: Yet Another Software Challenge
Message-Id: <f4co6o$7li$2@atlantis.news.tpi.pl>

yanosc@gmail.com wrote:
> Mr. Hearthfield has consciously decided to insult me just because
> there is a 1700 characters-long line of HTML (a markup language, not a
> programming language) in a page.
> 
> Do you really encourage teaching by insult?
> 

"No one can insult you without your permission."

And I wouldn't assume he even tried. He just expressed his own opinion, 
you don't have to agree with. In fact, any html browser that crashes 
because it assumes anything about lines lenght is a poorly written piece 
of software. If your pages are generated, not written by hand, I 
wouldn't bother "fixing it" as long as they are valid html.

-- 
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D


------------------------------

Date: Fri, 08 Jun 2007 23:45:04 +0000
From: Richard Heathfield <rjh@see.sig.invalid>
Subject: Re: Yet Another Software Challenge
Message-Id: <B7GdnZdu8K0edPTbnZ2dnUVZ8vudnZ2d@bt.com>

Grzegorz Wróbel said:

> In fact, any html browser that
> crashes because it assumes anything about lines lenght is a poorly
> written piece of software.

Certainly true, but in Konqueror's defence I must say that I have no 
reason to suspect that line length was the reason for the crash.

> If your pages are generated, not written by
> hand, I wouldn't bother "fixing it" as long as they are valid html.

The W3C validator <http://validator.w3.org/> found eleven errors in the 
page.

-- 
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.


------------------------------

Date: Sat, 09 Jun 2007 02:06:37 +0200
From: =?ISO-8859-1?Q?Grzegorz_Wr=F3bel?= </dev/null@localhost.localdomain>
Subject: Re: Yet Another Software Challenge
Message-Id: <f4cq5j$gn8$1@atlantis.news.tpi.pl>

Richard Heathfield wrote:
>> If your pages are generated, not written by
>> hand, I wouldn't bother "fixing it" as long as they are valid html.
> 
> The W3C validator <http://validator.w3.org/> found eleven errors in the 
> page.
> 

Shame for Google ;)

-- 
Grzegorz Wróbel
http://www.4neurons.com/
677265676F727940346E6575726F6E732E636F6D


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 498
**************************************


home help back first fref pref prev next nref lref last post