Password Mask Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dgunner71
    New Member
    • Jun 2010
    • 110

    Password Mask Question

    All -

    I know I have seen this code somewhere, but cannot find it for the life of me.

    I would like to show all asterisks (*) filling any field with a password mask (i.e. not just the password). That is to say, even if the password is just 4 characters, the asterisks would continue until filling the box. I've illustrated this in the attached picture.

    As I said, I have seen this code before (and thought I copied to my library for the one time I might need) - any help will be greatly appreciated.

    Very best,

    Gunner
    [imgnothumb]http://bytes.com/attachments/attachment/7333d1385222550/passwordquestio n.jpg[/imgnothumb]
    Attached Files
    Last edited by NeoPa; Nov 24 '13, 04:00 AM. Reason: Made pic viewable.
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    Why do you want to do that?

    It does not make your password more secure.....

    Comment

    • Bala Kumaran
      New Member
      • Jan 2013
      • 30

      #3
      I think, You are telling about sha1 of password.

      You can find the sha1 here http://www.sha1-online.com/

      Comment

      • dgunner71
        New Member
        • Jun 2010
        • 110

        #4
        Luuk -

        It only offers security in that if someone does see the password (i.e. "Supervisor s") they do not know how long the password is. If someone sees ***** they can try common 5 letter words (for that user).

        This input mask will make all fields appear to be filled with asterisks.

        Thanks for any help.

        Comment

        • dgunner71
          New Member
          • Jun 2010
          • 110

          #5
          Thanks, Bala - but I think (not positive however) that I am looking for an input mask.

          I wasn't sure how this might fit into Access.

          Gunner

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32662

            #6
            An unusual request, as operators generally need the visual feedback to ensure they detect typos and accidentally hit keys. I don't believe I've ever come across code to handle this. It's equivalent to not showing anything at all. That can be handled pretty simply by capturing, but not echoing, keystrokes within the control.

            Remember though, that security strength relies on people using it. If they find a system impractical, and what you suggest may well be considered to be inadequately practical, they find ways around it so that the strength of the security becomes irrelevant.

            Comment

            • Luuk
              Recognized Expert Top Contributor
              • Mar 2012
              • 1043

              #7
              Ok, you mean something like this (password.php):
              Code:
              <html>
                      <head>
                              <title>password</title>
                              <script>
                                      function test() {
                                              a = document.getElementsByName("password");
                                              a[0].value = a[0].value + a[0].value;
                                      }
                              </script>
                      </head>
                      <body>
                      The posted password is: <?php echo $_POST['password'] ?> <br>
                              <form method="post">
                                      <input name="password" value="" type="password" onkeydown="test()">
                                      <input name="submit" type="submit">
                              </form>
                      </body>
              </html>
              This should then be tweaked to get the entered password because if you enter 'abc' the received password will be 'aabaabc' in this example....

              But tweaking is easy just add a space (or more than 1, on line#7), and ignore spaces in the password......

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32662

                #8
                You do realise this is an Access question Luuk? It's very unclear what this could add to anybody's understanding of the matter.

                Comment

                • Luuk
                  Recognized Expert Top Contributor
                  • Mar 2012
                  • 1043

                  #9
                  sorry i overlooked that this was a question in the 'microsoft access/vba'-section, and not in the 'php'-section.

                  Comment

                  • dgunner71
                    New Member
                    • Jun 2010
                    • 110

                    #10
                    NeoPa -

                    I may be explaining this poorly.

                    I have a "Users" form where all user accounts can be managed from. (I have my own security, my own log-in screen, etc.) For simplicity's sake, there are 2 user types - "Admin" and "User". The User can only view his/her account but the Admin has the ability to add, delete or view any account.

                    Currently when the admin views his/her account, everything appears normal. However, I have code in the form's OnCurrent event so that when they view another user's account, the password is asterisks (password mask). I could just as easily hide the controls when the Admin views another account (this may be a good option).

                    I was just curious if anyone had seen the code / mask for this. I'll keep looking and post it when I do find it. I'm pretty sure that I have it in my code library somewhere or scribbled in a notebook.

                    Thanks again for all your help!

                    Gunner

                    Comment

                    • dgunner71
                      New Member
                      • Jun 2010
                      • 110

                      #11
                      Luuk -

                      Thanks for your assistance, but as NeoPa pointed out, I am mono-lingual (VBA). But I do appreciate all your assistance.

                      Very best,

                      Gunner

                      Comment

                      • NeoPa
                        Recognized Expert Moderator MVP
                        • Oct 2006
                        • 32662

                        #12
                        That certainly is clearer now Gunner. Essentially you are looking for a way to display a set number of asterisks in place of a password value.

                        There is no easy way simply to format that. You say you believe you have something that does this from before. I very much doubt you have exactly what you're describing here. There is a "password" format such that each character is replaced by an asterisk, but you've explained that's not what you're talking about.

                        Nevertheless, I suspect you are on the right track when you consider simply not showing the control. It could be hidden then, in the required scenarios. If you must have it visible and showing asterisks (though I cannot see how that is any benefit at all) then you could change the .ControlSource in Form_Current() between your password field and "=""**********" "".

                        @Luuk.
                        No worries on posting in the wrong section. I'm glad it was a simple misunderstandin g as I was certainly confused as to what you may have meant. I don't often deal with such posts from a member who clearly has been quite involved on the site.

                        Comment

                        • dgunner71
                          New Member
                          • Jun 2010
                          • 110

                          #13
                          Thanks again, NeoPa.

                          I'm planning to just hide the password control. If I do come across the code I'm referring to I'll post it for the community.

                          Happy Thanksgiving.

                          Bernie

                          Comment

                          • NeoPa
                            Recognized Expert Moderator MVP
                            • Oct 2006
                            • 32662

                            #14
                            Hiding a control is very straightforward Bernie.

                            If you need the code for that it boils down to :
                            Code:
                            Me.MyControl.Visible = True/False
                            I find it works most easily if the value you set it to is a boolean expression rather than the literals True or False.

                            Thus, say a Boolean variable (blnMine) is already set with a value that indicates whether or not the account being reviewed belongs to the operator (if that's the logic you want), you would say :
                            Code:
                            Me.MyControl.Visible = blnMine

                            Comment

                            • zmbd
                              Recognized Expert Moderator Expert
                              • Mar 2012
                              • 5501

                              #15
                              Here's a little trick I picked up awhile ago

                              Open the control properties:
                              Format tab
                              back style to transparent
                              back color to white or something that will give a good contrast with the form's background
                              Fore color to match the form's background.

                              With ACC2010 this has become really easy with the themes type entries.
                              So for a control located in the details section:

                              Back Color = Access Theme 5
                              Fore Color = Background 1
                              Back Style = Transparent
                              (set the back style AFTER you set the other properties or Access will default it back to "normal")

                              The form's Detail's section back color = Background 1

                              Now when the control has focus, the background of the control changes color and the text becomes visible as a contrast (in this case the password mask. When the control doesn't have focus, the transparent background lets the form's background show thru, and if the control's fore ground is the same colour as the section's back color, then the text will "disappear" into the background.

                              What I like about this... NO CODE!

                              ALSO
                              This is the way that I will show users which control has the focus on larger forms; however, I leave the control's fore color set to "Text 1, Lighter 25%" or even just "Text 1" or what ever color looks the best against "Background 1"

                              (and yes, I switch between "colour" and "color" I hate the latter and use it only when required... "color" doesn't match how the word is pronounced and it just drives me nuts... so does "knife" - I mean really, if the letter is there then use it! "gnue"
                              arrrrrrggghhhhh .... I'm going back to the lab and watch things bubble into a tar like mass! (^-^)

                              Comment

                              Working...