Password

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Bruce
    Indigo Rose Customer
    • Jun 2001
    • 2134

    Password

    Using this code, how do I save the correct password they use to the registry?

    <IR_ACTIONS_LIST>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>This action script will ask the user for a password, and give them 3 tries to get it right</Comment>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>We'll give the user 3 tries</Comment>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%attempts_remaining%</Variable>
    <Value>3</Value>
    <Evaluate>0</Evaluate>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>While the user has any attempts remaining...</Comment>
    </Action>
    <Action name="WHILE">
    <Type>204</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%attempts_remaining% &amp;gt; 0</Condition>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>Prompt the user for their password</Comment>
    </Action>
    <Action name="Get Information">
    <Type>136</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Attention</DialogTitle>
    <FieldTitle>Please enter your password:</FieldTitle>
    <DefaultText/>
    <BrowseType>0</BrowseType>
    <Mask>1</Mask>
    <Variable>%EnteredText%</Variable>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>Try to find that password in a global list</Comment>
    </Action>
    <Action name="Find">
    <Type>114</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <TargetList>Passwords</TargetList>
    <ItemText>%EnteredText%</ItemText>
    <StartAfterPosition>-1</StartAfterPosition>
    <CaseSensitive>1</CaseSensitive>
    <Variable>%ItemIndex%</Variable>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%ItemIndex% = -1</Condition>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>The password is not valid (no matching password found)</Comment>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>Does the user have any tries left?</Comment>
    </Action>
    <Action name="IF">
    <Type>200</Type>
    <Function>1</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Condition>%attempts_remaining% &amp;gt; 1</Condition>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>3</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>The user still has attempts remaining</Comment>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>3</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>Prompt the user to try again</Comment>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>3</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Incorrect Password</DialogTitle>
    <DialogMessage>Incorrect password. Please try again.</DialogMessage>
    <Icon>1</Icon>
    <Variable>%Result%</Variable>
    <DialogType>0</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    <Action name="ELSE">
    <Type>206</Type>
    <Function>1</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>3</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>This was the user's last attempt</Comment>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>3</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>All attempts were not valid, so exit the application</Comment>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>3</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Incorrect Password</DialogTitle>
    <DialogMessage>Password verification failed.

    Press OK to exit the program.</DialogMessage>
    <Icon>1</Icon>
    <Variable>%Result%</Variable>
    <DialogType>0</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    <Action name="Exit">
    <Type>2</Type>
    <Function>0</Function>
    <DTIndentLevel>3</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="ELSE">
    <Type>206</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>The password is valid</Comment>
    </Action>
    <Action name="GOTO">
    <Type>209</Type>
    <Function>1</Function>
    <DTIndentLevel>2</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Label>Password is valid</Label>
    </Action>
    <Action name="END IF">
    <Type>201</Type>
    <Function>1</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>Decrease the number of attempts remaining by 1</Comment>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>1</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%attempts_remaining%</Variable>
    <Value>%attempts_remaining% - 1</Value>
    <Evaluate>1</Evaluate>
    </Action>
    <Action name="END WHILE">
    <Type>205</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="Blank Line">
    <Type>203</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    </Action>
    <Action name="LABEL">
    <Type>208</Type>
    <Function>1</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Label>Password is valid</Label>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle/>
    <DialogMessage>Password confirmed.</DialogMessage>
    <Icon>0</Icon>
    <Variable>%Result%</Variable>
    <DialogType>0</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    <Action name="Comment">
    <Type>202</Type>
    <Function>2</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Comment>The password-protected application continues on from here...</Comment>
    </Action>
    </IR_ACTIONS_LIST>
  • TJ_Tigger
    Indigo Rose Customer
    • Sep 2002
    • 3159

    #2
    Re: Password

    Is this something you really want to do? The registry is not a very safe place to store things if you want your app to be secure. I assume that you are putting a password into the registry because you are going to check to see if it is still there when the user returns?

    You should be able to create a key and then set the value using the password that they entered. Something like this. Look at the bottom of the script.

    // This action script will ask the user for a password, and give them 3 tries to get it right

    // We'll give the user 3 tries
    %attempts_remaining% = "3"

    // While the user has any attempts remaining...
    WHILE (%attempts_remaining% > 0)

    // Prompt the user for their password
    %EnteredText% = Dialog.GetInformation ("Attention", "Please enter your password:")

    // Try to find that password in a global list
    %ItemIndex% = GlobalList[Passwords].Find (%EnteredText%)

    IF (%ItemIndex% = -1)

    // The password is not valid (no matching password found)
    // Does the user have any tries left?
    IF (%attempts_remaining% > 1)
    // The user still has attempts remaining
    // Prompt the user to try again
    %Result% = Dialog.MessageBox ("Incorrect Password", "Incorrect password. Please try...", Ok, Exclamation)
    ELSE
    // This was the user's last attempt
    // All attempts were not valid, so exit the application
    %Result% = Dialog.MessageBox ("Incorrect Password", "Password verification failed. ...", Ok, Exclamation)
    Application.Exit
    END IF

    ELSE
    // The password is valid
    GOTO ("Password is valid")
    END IF

    // Decrease the number of attempts remaining by 1
    %attempts_remaining% = Evaluate (%attempts_remaining% - 1)
    END WHILE

    Password is valid
    Registry.SetValue ("HKEY_CURRENT_USER\\AMS\BruceTest\%UserName%", "regdata", "%Result%")
    Registry.CreateKey ("HKEY_CURRENT_USER\\AMS\BruceTest\%UserName%")
    %Result% = Dialog.MessageBox ("", "Password confirmed.", Ok, None)
    // The password-protected application continues on from here...
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

    Comment

    • Bruce
      Indigo Rose Customer
      • Jun 2001
      • 2134

      #3
      Re: Password

      Not quite sure I understand what this does... can ya send me an example? Small 1? BTW It will not matter if some one gets the password, (I'm sure it will be passed around anyway, It's just for the client to compare to their database. I have setup 5000 passwords I just need to confirm which one was applied.

      Many thanks!

      Comment

      Working...
      X