grep for punctuation in password

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

grep for punctuation in password

stevepiercy
For password validation, I want require at least one punctuation character (and other rules which I won't describe).

I'm looking at two ways to validate the existence of a punctuation character in a password.  One is to iterate over the password string by character and use [String_IsPunctuation].  The other method would be to use a regexp, but only if Lasso's implementation supports POSIX-style character classes, specifically "punct".

My questions are:

1. Which characters does [String_IsPunctuation] consider to be punctuation?

2. Does Lasso's regexp implementation support POSIX-style character classes?  If so, which characters does it consider to be punctuation?

--steve
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                   <http://www.StevePiercy.com>

------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: grep for punctuation in password

Trevor Borgmeier
Depending on what you are defining "punctuation" -- is any symbol
acceptible?

Perhaps you could simply remove all alphanumeric characters and spaces
and evaluate the result.  If the result's length is greater than 0, it's
valid.  That would be easy to do w/ regex.

-Trevor


-------- Original Message --------
From: Steve Piercy - Web Site Builder <[hidden email]>
To: [hidden email]
Subject: grep for punctuation in password
Date: Tuesday, August 08, 2006 1:09:10 PM

> For password validation, I want require at least one punctuation character (and other rules which I won't describe).
>
> I'm looking at two ways to validate the existence of a punctuation character in a password.  One is to iterate over the password string by character and use [String_IsPunctuation].  The other method would be to use a regexp, but only if Lasso's implementation supports POSIX-style character classes, specifically "punct".
>
> My questions are:
>
> 1. Which characters does [String_IsPunctuation] consider to be punctuation?
>
> 2. Does Lasso's regexp implementation support POSIX-style character classes?  If so, which characters does it consider to be punctuation?
>
> --steve
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                   <http://www.StevePiercy.com>
>
> ------------------------------
> LASSO MASTER CLASS - Orlando, FL
> Following the FileMaker Developer Conference
> 2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
> http://www.briandunning.com/lasso-training/
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:  
> http://www.listsearch.com/lassotalk.lasso?manage
>
>

------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: grep for punctuation in password

Bil Corry
In reply to this post by stevepiercy
Here's an example:

        var:'validPunct' = (lp_regexp_encode:'~!@#$%^&*()_+=-,./?><;\'":[]}{');
        var:'teststrings' = (:'abc!','abc','123','123#');
        iterate:$teststrings,local:'s';
                #s ' ' ((string_findregexp: #s, -find='['$validPunct']+', -ignorecase)->size > 0) '<br>';
        /iterate;

returns:

        abc! true
        abc false
        123 false
        123# true

- Bil


Steve Piercy - Web Site Builder wrote:
> For password validation, I want require at least one punctuation character (and other rules which I won't describe).
>
> I'm looking at two ways to validate the existence of a punctuation character in a password.  One is to iterate over the password string by character and use [String_IsPunctuation].  The other method would be to use a regexp, but only if Lasso's implementation supports POSIX-style character classes, specifically "punct".
>
> My questions are:
>
> 1. Which characters does [String_IsPunctuation] consider to be punctuation?
>
> 2. Does Lasso's regexp implementation support POSIX-style character classes?  If so, which characters does it consider to be punctuation?


------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: grep for punctuation in password

stevepiercy
In reply to this post by Trevor Borgmeier
That method only tests for the non-existence of alphanumeric and spaces, which still leaves a very large character-space, including diacritical characters, e.g éüî.

--steve


On Tuesday, August 8, 2006, [hidden email] (Trevor Borgmeier) pronounced:

>Depending on what you are defining "punctuation" -- is any symbol
>acceptible?
>
>Perhaps you could simply remove all alphanumeric characters and spaces
>and evaluate the result.  If the result's length is greater than 0, it's
>valid.  That would be easy to do w/ regex.
>
>-Trevor
>
>
>-------- Original Message --------
>From: Steve Piercy - Web Site Builder <[hidden email]>
>To: [hidden email]
>Subject: grep for punctuation in password
>Date: Tuesday, August 08, 2006 1:09:10 PM
>
>> For password validation, I want require at least one punctuation character (and other
>rules which I won't describe).
>>
>> I'm looking at two ways to validate the existence of a punctuation character in a
>password.  One is to iterate over the password string by character and use
>[String_IsPunctuation].  The other method would be to use a regexp, but only if Lasso's
>implementation supports POSIX-style character classes, specifically "punct".
>>
>> My questions are:
>>
>> 1. Which characters does [String_IsPunctuation] consider to be punctuation?
>>
>> 2. Does Lasso's regexp implementation support POSIX-style character classes?  If so,
>which characters does it consider to be punctuation?
>>
>> --steve
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy               Web Site Builder               Soquel, CA
>> <[hidden email]>                   <http://www.StevePiercy.com>
>>
>> ------------------------------
>> LASSO MASTER CLASS - Orlando, FL
>> Following the FileMaker Developer Conference
>> 2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
>> http://www.briandunning.com/lasso-training/
>>
>>
>> ------------------------------
>> Lasso Support: http://support.omnipilot.com/
>> Search the list archives: http://www.listsearch.com/lassotalk.lasso
>> Manage your list subscription:  
>> http://www.listsearch.com/lassotalk.lasso?manage
>>
>>
>
>------------------------------
>LASSO MASTER CLASS - Orlando, FL
>Following the FileMaker Developer Conference
>2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
>http://www.briandunning.com/lasso-training/
>
>
>------------------------------
>Lasso Support: http://support.omnipilot.com/
>Search the list archives: http://www.listsearch.com/lassotalk.lasso
>Manage your list subscription:  
>http://www.listsearch.com/lassotalk.lasso?manage
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                   <http://www.StevePiercy.com>

------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: grep for punctuation in password

James Harvard
Yes, Lasso does support Posix character classes. Here's a regexp pattern that uses 'look ahead' positional assertions to test in one pass whether  the password is 6 to 12 characters long and contains at least one digit and punctuation character. Mmmm, positional assertions ....

iterate( array('foobar','foobar7','foo;bar7','$oo8ar'), var('i') );
        $i;
        ': ';
        boolean(string_findregexp($i,-find='^(?=.*[0-9].*)(?=.*[[:punct:]].*).{6,12}$')->size);
        '<br />';
/iterate;

------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: grep for punctuation in password

stevepiercy
In reply to this post by Bil Corry
Well, that doesn't answer my questions.  I know I could define my own character classes, but I wanted to know how Lasso defines its built-in character classes.

--steve


On Tuesday, August 8, 2006, [hidden email] (Bil Corry) pronounced:

>Here's an example:
>
>   var:'validPunct' = (lp_regexp_encode:'~!@#$%^&*()_+=-,./?><;\'":[]}{');
>   var:'teststrings' = (:'abc!','abc','123','123#');
>   iterate:$teststrings,local:'s';
>       #s ' ' ((string_findregexp: #s, -find='['$validPunct']+', -ignorecase)->size > 0)
>'<br>';
>   /iterate;
>
>returns:
>
>   abc! true
>   abc false
>   123 false
>   123# true
>
>- Bil
>
>
>Steve Piercy - Web Site Builder wrote:
>> For password validation, I want require at least one punctuation character (and other
>rules which I won't describe).
>>
>> I'm looking at two ways to validate the existence of a punctuation character in a
>password.  One is to iterate over the password string by character and use
>[String_IsPunctuation].  The other method would be to use a regexp, but only if Lasso's
>implementation supports POSIX-style character classes, specifically "punct".
>>
>> My questions are:
>>
>> 1. Which characters does [String_IsPunctuation] consider to be punctuation?
>>
>> 2. Does Lasso's regexp implementation support POSIX-style character classes?  If so,
>which characters does it consider to be punctuation?
>
>
>------------------------------
>LASSO MASTER CLASS - Orlando, FL
>Following the FileMaker Developer Conference
>2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
>http://www.briandunning.com/lasso-training/
>
>
>------------------------------
>Lasso Support: http://support.omnipilot.com/
>Search the list archives: http://www.listsearch.com/lassotalk.lasso
>Manage your list subscription:  
>http://www.listsearch.com/lassotalk.lasso?manage
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                   <http://www.StevePiercy.com>

------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: grep for punctuation in password

stevepiercy
In reply to this post by James Harvard
Very nice.

foobar: false
foobar7: false
foo;bar7: true
$oo8ar: true

Next question: which characters does [[:punct:]] define as punctuation?  It would be helpful to provide that list of characters to the users when they register.

I've read mention that it depends on something called a "locale", but the geek-speak in man pages is heavy on technical details and abstraction, without firmly declaring that puncuation consists of the following set of characters: "blahblahblah".

--steve


On Tuesday, August 8, 2006, [hidden email] (James Harvard) pronounced:

>Yes, Lasso does support Posix character classes. Here's a regexp pattern that uses 'look
>ahead' positional assertions to test in one pass whether  the password is 6 to 12
>characters long and contains at least one digit and punctuation character. Mmmm,
>positional assertions ....
>
>iterate( array('foobar','foobar7','foo;bar7','$oo8ar'), var('i') );
>   $i;
>   ': ';
>  
>boolean(string_findregexp($i,-find='^(?=.*[0-9].*)(?=.*[[:punct:]].*).{6,12}$')->size);
>   '<br />';
>/iterate;
>
>------------------------------
>LASSO MASTER CLASS - Orlando, FL
>Following the FileMaker Developer Conference
>2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
>http://www.briandunning.com/lasso-training/
>
>
>------------------------------
>Lasso Support: http://support.omnipilot.com/
>Search the list archives: http://www.listsearch.com/lassotalk.lasso
>Manage your list subscription:  
>http://www.listsearch.com/lassotalk.lasso?manage
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                   <http://www.StevePiercy.com>

------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: grep for punctuation in password

Bil Corry
In reply to this post by stevepiercy
Steve Piercy - Web Site Builder wrote:
> Well, that doesn't answer my questions.  I know I could define my own character classes, but I wanted to know how Lasso defines its built-in character classes.

You can test it and see:

        loop: -from=32, -to=127;
        if: (string_ispunctuation: (lp_string_chr: loop_count));
                (lp_string_chr: loop_count) ' ';
        /if;
        /loop;

Returns:

        ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~


- Bil


------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: grep for punctuation in password

Bil Corry
In reply to this post by stevepiercy
Steve Piercy - Web Site Builder wrote:
> Next question: which characters does [[:punct:]] define as punctuation?

        loop: -from=32, -to=127;
        if: boolean(string_findregexp((lp_string_chr: loop_count),-find='[[:punct:]]+')->size); // adapted from James' post
                (lp_string_chr: loop_count) ' ';
        /if;
        /loop;

Returns:

        ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~

        (same as string_ispunctuation)

- Bil


------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: grep for punctuation in password

Trevor Borgmeier
In reply to this post by stevepiercy
That's true. That's why I asked what you were considering punctuation --
in case you used the word punctuation but weren't meaning to be so limiting.

Are these these characters @#$%&* acceptable?  Are they considered
punctuation?

If you have set characters that you want to require, I would just use
Bil's method where you list them in a regex.

I'm not sure how defining them yourself is worse than using
String_IsPunctuation with regex you won't need to iterate through for
each character so it should be much faster..

Plus you have immediate control of what characters you require.

-Trevor






-------- Original Message --------
From: Steve Piercy - Web Site Builder <[hidden email]>
To: [hidden email]
Subject: Re:grep for punctuation in password
Date: Tuesday, August 08, 2006 1:53:19 PM

> That method only tests for the non-existence of alphanumeric and spaces, which still leaves a very large character-space, including diacritical characters, e.g éüî.
>
> --steve
>
>
> On Tuesday, August 8, 2006, [hidden email] (Trevor Borgmeier) pronounced:
>
>> Depending on what you are defining "punctuation" -- is any symbol
>> acceptible?
>>
>> Perhaps you could simply remove all alphanumeric characters and spaces
>> and evaluate the result.  If the result's length is greater than 0, it's
>> valid.  That would be easy to do w/ regex.
>>
>> -Trevor
>>
>>
>> -------- Original Message --------
>> From: Steve Piercy - Web Site Builder <[hidden email]>
>> To: [hidden email]
>> Subject: grep for punctuation in password
>> Date: Tuesday, August 08, 2006 1:09:10 PM
>>
>>> For password validation, I want require at least one punctuation character (and other
>> rules which I won't describe).
>>> I'm looking at two ways to validate the existence of a punctuation character in a
>> password.  One is to iterate over the password string by character and use
>> [String_IsPunctuation].  The other method would be to use a regexp, but only if Lasso's
>> implementation supports POSIX-style character classes, specifically "punct".
>>> My questions are:
>>>
>>> 1. Which characters does [String_IsPunctuation] consider to be punctuation?
>>>
>>> 2. Does Lasso's regexp implementation support POSIX-style character classes?  If so,
>> which characters does it consider to be punctuation?
>>> --steve
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy               Web Site Builder               Soquel, CA
>>> <[hidden email]>                   <http://www.StevePiercy.com>
>>>
>>> ------------------------------
>>> LASSO MASTER CLASS - Orlando, FL
>>> Following the FileMaker Developer Conference
>>> 2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
>>> http://www.briandunning.com/lasso-training/
>>>
>>>
>>> ------------------------------
>>> Lasso Support: http://support.omnipilot.com/
>>> Search the list archives: http://www.listsearch.com/lassotalk.lasso
>>> Manage your list subscription:  
>>> http://www.listsearch.com/lassotalk.lasso?manage
>>>
>>>
>> ------------------------------
>> LASSO MASTER CLASS - Orlando, FL
>> Following the FileMaker Developer Conference
>> 2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
>> http://www.briandunning.com/lasso-training/
>>
>>
>> ------------------------------
>> Lasso Support: http://support.omnipilot.com/
>> Search the list archives: http://www.listsearch.com/lassotalk.lasso
>> Manage your list subscription:  
>> http://www.listsearch.com/lassotalk.lasso?manage
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                   <http://www.StevePiercy.com>
>
> ------------------------------
> LASSO MASTER CLASS - Orlando, FL
> Following the FileMaker Developer Conference
> 2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
> http://www.briandunning.com/lasso-training/
>
>
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:  
> http://www.listsearch.com/lassotalk.lasso?manage
>
>

------------------------------
LASSO MASTER CLASS - Orlando, FL
Following the FileMaker Developer Conference
2 Day intensive seminar: Learn the best way to get your FileMaker data on the web.
http://www.briandunning.com/lasso-training/


------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage