From andrew at broscom.com Mon Aug 4 08:25:45 2003 From: andrew at broscom.com (Andrew Brosnan) Date: Mon Aug 2 21:33:08 2004 Subject: [Nh-pm] encryption recommendation Message-ID: Hello, Can someone recommend a method or module for encrypting and decrypting strings(passwords)? I'm a little overwhelmed by the choices on the CPAN, some of which have quite a long list of dependencies. Simple is good. Regards, Andrew From ben at blackavar.com Mon Aug 4 09:15:59 2003 From: ben at blackavar.com (Ben Boulanger) Date: Mon Aug 2 21:33:08 2004 Subject: [Nh-pm] encryption recommendation In-Reply-To: References: Message-ID: <1060006486.3501.2.camel@bensbox.blackavar.com> On Mon, 2003-08-04 at 09:25, Andrew Brosnan wrote: > Can someone recommend a method or module for encrypting and decrypting strings(passwords)? I'm a little overwhelmed by the choices on the CPAN, some of which have quite a long list of dependencies. If you're looking for simple, I just use the crypt routine. Here's sample code: my $salt = &generate_random_salt; my $password = crypt($password, $salt); sub generate_random_salt { my @range = ('A'..'Z','a'..'z','0'..'9','.','/'); my $highest_array_value = $#range; my $random_number1 = rand $highest_array_value; my $random_number2 = rand $highest_array_value; my $return_salt = $range[$random_number1] . $range[$random_number2]; return $return_salt; } From andrew at broscom.com Mon Aug 4 09:53:55 2003 From: andrew at broscom.com (Andrew Brosnan) Date: Mon Aug 2 21:33:08 2004 Subject: [Nh-pm] encryption recommendation In-Reply-To: <1060006486.3501.2.camel@bensbox.blackavar.com> Message-ID: On 8/4/03 at 10:14 AM, ben@blackavar.com (Ben Boulanger) wrote: > On Mon, 2003-08-04 at 09:25, Andrew Brosnan wrote: > > Can someone recommend a method or module for encrypting and > > decrypting > > strings(passwords)? I'm a little overwhelmed by the choices on the > > CPAN, some of which have quite a long list of dependencies. > > If you're looking for simple, I just use the crypt routine. Here's > sample code: > > my $salt = &generate_random_salt; > my $password = crypt($password, $salt); > > sub generate_random_salt { > my @range = ('A'..'Z','a'..'z','0'..'9','.','/'); > my $highest_array_value = $#range; > my $random_number1 = rand $highest_array_value; > my $random_number2 = rand $highest_array_value; > my $return_salt = $range[$random_number1] . > $range[$random_number2]; > return $return_salt; > } > > That just does one way encryption. I need decryption too. From ben at blackavar.com Mon Aug 4 10:07:12 2003 From: ben at blackavar.com (Ben Boulanger) Date: Mon Aug 2 21:33:08 2004 Subject: [Nh-pm] encryption recommendation In-Reply-To: References: Message-ID: <1060009556.3501.7.camel@bensbox.blackavar.com> On Mon, 2003-08-04 at 10:53, Andrew Brosnan wrote: > That just does one way encryption. I need decryption too. You mentioned passwords? The way to verify a password is correct against the crypted version is to use the crypted version as the salt. If, when using the crypted version as the salt, you get the same string back, it's the correct password. if the crypted version of "string" is 11111111 then, crypt ("string", "11111111") will give you "11111111" that do it for you, or do you need something you can decrypt and display? From andrew at broscom.com Mon Aug 4 10:21:03 2003 From: andrew at broscom.com (Andrew Brosnan) Date: Mon Aug 2 21:33:08 2004 Subject: [Nh-pm] encryption recommendation In-Reply-To: <1060009556.3501.7.camel@bensbox.blackavar.com> Message-ID: On 8/4/03 at 11:05 AM, ben@blackavar.com (Ben Boulanger) wrote: > On Mon, 2003-08-04 at 10:53, Andrew Brosnan wrote: > > That just does one way encryption. I need decryption too. > > You mentioned passwords? Yes, but I'm following a spec, that's why I mentioned decrypt too :-) > do you need something you can decrypt and display? Yep. Just for an admin function, not for authentication. Anyway Chris' suggestion looks fine. Thanks Andrew From plussier at mindspring.com Tue Aug 5 22:09:35 2003 From: plussier at mindspring.com (Paul Lussier) Date: Mon Aug 2 21:33:08 2004 Subject: [Nh-pm] encryption recommendation In-Reply-To: Message from Andrew Brosnan of "Mon, 04 Aug 2003 11:21:03 EDT." References: Message-ID: <20030806030936.029D9BADB@taz> In a message dated: Mon, 04 Aug 2003 11:21:03 EDT Andrew Brosnan said: >On 8/4/03 at 11:05 AM, ben@blackavar.com (Ben Boulanger) wrote: > >> On Mon, 2003-08-04 at 10:53, Andrew Brosnan wrote: >> > That just does one way encryption. I need decryption too. >> >> You mentioned passwords? >Yes, but I'm following a spec, that's why I mentioned decrypt too :-) > >> do you need something you can decrypt and display? >Yep. Just for an admin function, not for authentication. > >Anyway Chris' suggestion looks fine. I haven't seen Chris' suggestion, but be aware, other than actually cracking the password, you can't decrypt a UNIX style password, DES or MD5. They're one-way hashes. -- Seeya, Paul ---- It may look like I'm just sitting here doing nothing, but I'm really actively waiting for all my problems to go away. If you're not having fun, you're not doing it right! From fblack at docucorp.com Thu Aug 28 16:00:00 2003 From: fblack at docucorp.com (Black, Franklin) Date: Mon Aug 2 21:33:08 2004 Subject: [Nh-pm] Outlook Message-ID: <60F043336182D3118E930050041891973D7660@BED1CN02> Doe anyone have an example of connecting to outlook and sending an email? From kclark at CetaceanNetworks.com Thu Aug 28 16:36:15 2003 From: kclark at CetaceanNetworks.com (Kevin D. Clark) Date: Mon Aug 2 21:33:08 2004 Subject: [Nh-pm] Outlook In-Reply-To: <60F043336182D3118E930050041891973D7660@BED1CN02> References: <60F043336182D3118E930050041891973D7660@BED1CN02> Message-ID: "Black, Franklin" writes: > Doe anyone have an example of connecting to outlook and sending an email? Why not just use the Exchange server (I assume you have one of these) as an SMTP server and use one of the many Mail modules available for Perl? This should be easy and straightforward. Regards, --kevin -- Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA) cetaceannetworks.com!kclark (GnuPG ID: B280F24E) alumni.unh.edu!kdc