SHA1 Hash for Access/VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RisoSystems
    New Member
    • Oct 2011
    • 11

    SHA1 Hash for Access/VBA

    I've been looking for a SHA1 routine for an Access 2010 project. A Google search turns up quite a few for Visual Basic but not for current level vba.

    This needs to be implemented entirely in Access vba - I'm trying not to call an external program (I can do it now with REST if I have to).

    Can anyone point me to a source?

    Thanks
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Will SHA2 work? http://bytes.com/topic/access/insigh...m-vba-vbscript

    Comment

    • patjones
      Recognized Expert Contributor
      • Jun 2007
      • 931

      #3
      Try this Insight article right here on our site: SHA2 Cryptographic Hash Algorithm for VBA and VBScript.

      Comment

      • RisoSystems
        New Member
        • Oct 2011
        • 11

        #4
        Thanks, guys, but in this environment I'm limited to SHA1.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32662

          #5
          Great minds think alike it seems. I will avoid posting another link to the same article the others already have (They cross-posted so perfectly understandable they did).

          What I would say though is that some VB code shouldn't be too complicated to translate into VBA. There are few real syntactic differences after all, even if available libraries may differ somewhat.

          Comment

          • RisoSystems
            New Member
            • Oct 2011
            • 11

            #6
            @NeoPa - you're right. I'm just a lazy SOB. ;)

            Comment

            • Rabbit
              Recognized Expert MVP
              • Jan 2007
              • 12517

              #7
              Well, SHA1 shares similarities with SHA2. I used the pseudocode from the wikipedia page to develop the VBS/VBA code in the article. You should be able to use the SHA1 pseudocode in the wikipedia page and do the same thing. And if you run into trouble, perhaps it's something I already handled in my SHA2 code. Or you could start with my SHA2 code and then transform it to SHA1.

              Comment

              • RisoSystems
                New Member
                • Oct 2011
                • 11

                #8
                @Rabbit. Thanks for the offer. I'll use REST for now, as I'm under time constraints. But when I have a gap, I'll give it a go and get back to you. J.

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32662

                  #9
                  Originally posted by RisoSystems
                  RisoSystems:
                  @NeoPa - you're right. I'm just a lazy SOB. ;)
                  I can hardly argue with that sentiment. I believe {Insert your own term for creative power} gave me my intelligence primarily to help me avoid effort in life :-D

                  Comment

                  • patjones
                    Recognized Expert Contributor
                    • Jun 2007
                    • 931

                    #10
                    I'm surprised that you did not find anything when you googled for SHA1 VBA. I recently updated from MD5 to SHA1 in one of my projects and I'm pretty sure I found it just by doing a google search. Maybe the one password-hash-function-for-excel-vba for instance...
                    Last edited by NeoPa; Oct 21 '11, 06:58 PM. Reason: You leave me in a quandary as posting links to Stack-Overflow is not allowed here.

                    Comment

                    • RisoSystems
                      New Member
                      • Oct 2011
                      • 11

                      #11
                      @zepp - Thanks! I'd found an earlier version of that which didn't work, and overlooked that one. Perfect.

                      Comment

                      • ADezii
                        Recognized Expert Expert
                        • Apr 2006
                        • 8834

                        #12
                        @RisoSystems:
                        Download the Attachment, and see if this is what you are looking for.
                        Attached Files

                        Comment

                        • RisoSystems
                          New Member
                          • Oct 2011
                          • 11

                          #13
                          @ADezii - Thanks. Have already implemented the one Zepp suggested.
                          - as an aside - I've found this board more useful in 2 days than others I've looked at for months. I'm very appreciative.

                          Comment

                          Working...