Dynamic Password Generation

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Dynamic Password Generation

    I am looking for ideas of the best way to create a dynamic password when a user
    registers with an online service. You know the sort of thing...tt would be
    stored in DB, and sent to the email address provided by the user. When the user
    returns and authenticates with their username and dynamic password they were
    sent, they can change the password to their liking.

    This is the first time I have been tasked with this sort of thing, so any
    advice and/or tips are very much appreciated. Thanks.

    CFDevGuy Guest

  2. Similar Questions and Discussions

    1. Dynamic KFP Generation
      We have the need for dynamic (real-time) generatation of a KFP file (Acrobat Preflight Profile) based on metadata managed in a SQL database for use...
    2. Dynamic Select Generation
      I created a dynamic select tag using information I pulled from an Access database. What I want to know is how you set the first item in the drop...
    3. Dynamic PDF generation
      we have CFMX 2004 on Linux I would like to know what it takes or what all I need to Retrieve the data from database and generate PDF ( Setting...
    4. dynamic Flash generation
      Does anyone know of a framework for dynamic Flash content generation? A sort of web app framework that dynamically generates Flash SWFs based on...
    5. Dynamic Screen Generation
      It is possible using mx2004 Pro to create screens dynamically? I have a bunch of custom components and want to use xml to basically create those...
  3. #2

    Default Re: Dynamic Password Generation

    you could use this and change it as needed


    [url]http://www.macromedia.com/cfusion/exchange/index.cfm#loc=en_us&view=sn106&viewNa[/url]
    me=Exchange%20Search%20Details&authorid=33575664&p age=0&scrollPos=0&subcatid=0&s
    nid=sn106&itemnumber=17&extid=1001895&catid=0

    jorgepino Guest

  4. #3

    Default Re: Dynamic Password Generation

    Thanks Jorge, I will try it out. I don't know how I missed that :-)
    CFDevGuy Guest

  5. #4

    Default Re: Dynamic Password Generation

    Two files, one cfc and one cfm.

    Calling page, saved, for example, as pwgen.cfm:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Alphanumeric password generation</title>
    </head>
    <body>
    <!--- Call the CFC for password generation, passwordgen.cfc --->
    <cfinvoke component="password_gen" method="generatePassword"
    returnvariable="password">
    <cfinvokeargument name="passwordLength" value="6">
    </cfinvoke>
    <cfoutput>password: #password#</cfoutput>
    </body>
    </html>

    <!---
    Component for alphanumeric password generation.
    Only one required input, the password length.

    Author: BKBK, July 13, 2005

    Save it, for example, as file password_gen.cfc
    --->
    <cfcomponent displayname="passwordGenerator" hint="Contains method for
    generating password of given length">
    <cffunction name="generatePassword" output="No" returntype="string">
    <cfargument name="passwordLength" type="numeric" required="Yes">
    <cfset password = "">
    <cfloop condition="0 EQ 0">
    <!--- Random integer between 49 and 122 --->
    <cfset i = #randRange(49,122)#>
    <cfset condition = NOT (i GT 57 AND i LT 65) and NOT (i GT 90 AND i LT 97)
    and (NOT (i EQ 79) AND NOT (i EQ 111))>
    <cfif (Len(password) LT #arguments.passwordLength#) and condition>
    <!---
    Construct random alphanumeric password of length #passwordLength#,
    using digits, capital letters and small letters. Exceptions are zero(0)
    capital letter O amd small letter o, which often confuse the user.
    --->
    <cfset password = password&chr(i)>
    </cfif>
    <cfif Len(password) EQ #arguments.passwordLength#>
    <cfbreak>
    </cfif>
    </cfloop>
    <cfreturn password>
    </cffunction>
    </cfcomponent>

    BKBK Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139