× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



very nice Scott!

Is there a spell check api on the as400?  If so, maybe it could be called
with the phonetic character sequence password and return a list of actual
words that are closest to it.  That would give a random actual word
password.

Steve Richter

-----Original Message-----
From: midrange-l-admin@midrange.com
[mailto:midrange-l-admin@midrange.com]On Behalf Of Scott Klement
Sent: Wednesday, October 23, 2002 6:31 PM
To: midrange-l@midrange.com
Subject: Re: Need to generate passwords


On Wed, 23 Oct 2002, McKay, Steve wrote:
>
> Does anyone have a CL/RPG/COBOL solution to generate "random" passwords?
> Auditing has a problem with me "assigning" an initial password (even if
> it is set to "*EXPIRED") and wants to programatically generate a
> password for each new user.
>

Hi Steve,

A few considerations:

    1) When generating a random password, make sure that the password
        can be pronounced.  Don't use a "real word", but whatever nonsense
        word the system comes up with should be something the user can
        pronounce.  Why?  Because if the user can't pronounce it, he
        won't remember it, and it'll end up on a post-it on the side of
        his monitor.

    2) No user ever remembers his password when he first gets it.
        I like the idea of giving him the password written on the
        back of a business card.   Tell him to put that card in his
        wallet (or purse) and never show it to anyone.  Once he's
        able to remember the password, tell him to destroy the card.


Here's the program that I use to generate the passwords.  Note that it
will generate a consonant, then a vowel, then a consonant, etc.   The
idea is to come up with something that you can pronounce.

When I run this, I sometimes will hit enter a few times (to make to
generate a new password) until I get one that I think will be easy
enough to learn.

Here's the code:

     H DFTACTGRP(*NO) BNDDIR('QC2LE')

     D srand           PR                  extproc('srand')
     D   seed                        10U 0 value
     D rand            PR            10I 0 extproc('rand')
     D consonant       PR             1A
     D vowel           PR             1A

     D dsTS            DS
     D   dsTS_1                        Z
     d   dsTS_Date                   10A   overlay(dsTS_1:1)
     d   dsTS_Time                    8A   overlay(dsTS_1:12)
     d   dsTS_Milli                   6A   overlay(dsTS_1:21)
     d   dsTS_sec1                    1A   overlay(dsTS_Time:7)
     d   dsTS_sec2                    1A   overlay(dsTS_Time:8)
     d   dsTS_ms1                     1A   overlay(dsTS_Milli:1)
     d   dsTS_ms2                     1A   overlay(dsTS_Milli:2)
     d   dsTS_ms3                     1A   overlay(dsTS_Milli:3)

     D dsSeed          DS
     D   dsSeed_1                     5S 0 inz(0)
     D   dsSeed_2                     2S 0 overlay(dsSeed_1:1)
     D   dsSeed_ms3                   1A   overlay(dsSeed_1:1)
     D   dsSeed_ms1                   1A   overlay(dsSeed_1:2)
     D   dsSeed_sec2                  1A   overlay(dsSeed_1:3)
     D   dsSeed_sec1                  1A   overlay(dsSeed_1:4)
     D   dsSeed_ms2                   1A   overlay(dsSeed_1:5)

     D wkMsg           S             50A
     D wkReply         S              1A

     C****************************************************************
     C* Mangle the time, and use it to seed the random number generator
     C****************************************************************
     c                   time                    dsTS_1

     c                   eval      dsSeed_ms1 = dsTS_ms1
     c                   eval      dsSeed_ms2 = dsTS_ms2
     c                   eval      dsSeed_ms3 = dsTS_ms3
     c                   eval      dsSeed_sec1 = dsTS_sec1
     c                   eval      dsSeed_sec2 = dsTS_sec2

     c                   dow       dsSeed_2 > 31
     c                   eval      dsSeed_2 = dsSeed_2 - 31
     c                   enddo

     c                   callp     srand(dsSeed_1)

     C****************************************************************
     C* Make a password that consists of 7 chars, consonants and
     C* vowels every other char
     C****************************************************************
     c                   dou       wkReply='N' or wkReply='n'

     c                   eval      wkMsg = 'Password = ' +
     c                                      consonant +
     c                                      vowel +
     c                                      consonant +
     c                                      vowel +
     c                                      consonant  +
     c                                      vowel +
     c                                      consonant  +
     c                                      '  Calculate another?'

     c     wkMsg         dsply                   wkReply

     c                   enddo

     c                   eval      *inlr = *on


      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      *  this returns a random consonant
      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     P consonant       B
     D consonant       PI             1A
     D x               S             10I 0
     D c               S             21A   INZ('BCDFGHJKLMNPQRSTVWXZ')
     c                   eval      x = %rem(rand: 20) + 1
     c                   return    %subst(c:x:1)
     P                 E


      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      *  this returns a random vowel
      *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     P vowel           B
     D vowel           PI             1A
     D x               S             10I 0
     D v               S             21A   INZ('AEIOUY')
     c                   eval      x = %rem(rand: 6) + 1
     c                   return    %subst(v:x:1)
     P                 E

_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.