locked
Suggestion? RRS feed

  • Question

  • For years, I have been using a Active X component named ChilkatCrypt2.dll to encrypt/decrypt passwords used in my access applications.  It has worked great and was easy to use.  Only difficulty was if the customer got a new machine and didn't register the dll.

    Now I had to switch to Windows 10 and Access 2019, and it stopped working.  I don't think it is due to Windows 10, as many of my customer are using windows 10 with the dll and not having any troubles.  That it makes me believe it is due to access 209, which none of my customers are using. 

    The vendor is not being of too much help to get it working, and I appear to be hearing that I should perhaps cease and desist using Active X components anyhow.

    Does anyone have any suggestions/examples of how I should either get it working or suggestions/examples of alternative ways to do this?


    • Edited by tkosel Thursday, July 30, 2020 9:16 PM
    Thursday, July 30, 2020 9:15 PM

Answers

  • If you running x32 bit office then you must use x32 bit .dll’s.

    If you are running x64 bit office, then you must use x64 bit .dll’s.

    The OS will NOT matter.

    For a good 10 years, 99% of windows has been x64 bits.

    But, for that same good 10 years, 99% of Office installs been x32 bits.

    So, really, the OS bit size does not matter, and you don’t care.

    You ONLY care about the bit size of office – period!!!

    > Can you have both a 32 bit and 64 bit version of the same dll loaded?

    I think you mean “registered”. In this context, registered is the key concept. Loading is a different context, different idea, and something that occurs AFTER the install (registering of that .dll and software).

    > of the same dll loaded?

    Well, we should NOT call this the same .dll. You have an x32 one and an x64 bit one. So, they are thus NOT the same anymore, are they?

    What you really are asking;

    A vendor has provided me with an x64 bit version of .dll

    That same vendor has provided me with an x32 version of a .dll

    Question:

    Can I install and register both the x32 bit .dll, and the x64 bit version of the .dll?

    The answer?

    It will DEPEND on the vendor if they allow and support this.

    So, is it is possible to install (register) both versions?

    Yes, you can, but ONLY if the vendor allows this. Some don’t support such a setup.

    For example, Microsoft does NOT allow and DOES NOT support office x32 and office x64 installs on ONE computer at the same time!

    This limitation applies to a GIVEN version of office.

    Part of the reason is that MUCH of office is shared code. (Ribbon, spell check, VBA system – a HUGE part of office is shared code).

    So, if you have parts of office as x32 (say Excel and word). Then you are not allowed to install any x64 parts. And you (or Microsoft) could never really be sure what bits and parts match, and what parts do not. So, x32 software cannot consume or run x64 bit software. (and reverse is true).

    And if they did attempt this? It very problematic.

    As a result? Microsoft does not allow such a setup (mix x32 and x64 office). And the installers will PREVENT you from doing this.

    So, some vendors allow and support x32 and x64 bit version installs "side by side". Some do not.

    However:

    Is it technically possible to “register” x32 and x64 bit versions of two .dll's?

    Yes, you can. However, this will come down to vendor support.

    Keep in mind:

    There is an x64 bit version of regsvr32.

    There is an x32 bit version of regsvr32.

    So, you MUST use the correct version of regsvr32, and it will NOT work if you use the WRONG version of regsvr32 to register a .dll that does not match the bit size of regsvr32.

    So, not only do you need an x64 bit .dll, you ALSO have to be VERY (BUT VERY) sure you run the correct version of regsv32.

    (Windows will NOT make this choice for you – YOU must!!!).

    So, the match of software and .dll used has to be the same

    (x32, or x64). Of course both x32 and x64 bit software runs fine on windows x64 (it supports both systems). (they don't tell you - but you have two versions of windows software on your computer!!!!).

    And VERY carefully note this again:

    Windows does not know or chose the right version of regsv32 to use here. YOU must choose the correct version! (Or the vendor will provide you with an installer that has this choice made for you!!!).

    So, this means:

    You have an .x64 bit version of the .dll

    You use the .x64 bit version of regsvr32

    And you have an x32 bit version of the .dll

    You use the x32 bit version of regsvr32

    See the pattern here?

    The OS bit version does NOT really matter here.

    What matters is any software you use?

    Then that software MUST use and run the same bit size software – including 3rd  party add-ons and .dlls.

    So, yes, you can register both an x32 bit version and x64 bit vision of a .dll. This would be two separate and distinct uses of regsvr32. And you talking about two separate and distinct .dll’s.

    So, this is NOT the same .dll.

    Also, are you really running x64 bit office now?

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada


    • Edited by Albert D. Kallal Saturday, August 1, 2020 2:53 PM
    • Marked as answer by tkosel Tuesday, August 4, 2020 9:57 PM
    Saturday, August 1, 2020 2:42 PM
  • Albert,

    Thanks for your response.  I mistakenly ordered the 64 bit version of office on my new machine.  Uninstalled it and installed the 32 bit version and everything is fine.

    Thanks for your very complete, informative post.

    • Marked as answer by tkosel Tuesday, August 4, 2020 10:04 PM
    Tuesday, August 4, 2020 10:01 PM

All replies

  • Could it be the difference between 32-bit and 64-bit?

    Any specific error messages?


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net


    Thursday, July 30, 2020 9:53 PM
  • Daniel,

    Thanks as usual for your timely response. 

    I have previously used the 32 bit version in windows XP and 7, registered using regsvr32.  My windows 7 install was a 64 bit install.   My customers are successfully using it in Windows 10, with access 2013, and the 32 bit version, using regsvr32 to register it. 

    The vendor recommends using the 32 bit version, so I registered it in Windows 10, using regsvr32 and it registered successfully.  However, it does not work.  I think it is a Access 2019 issue.  What do you think?

    No specific error messages.  This is a portion of my code which has always worked in the past.  V_Success now returns a empty value all the time.  When it worked, it returned a value of 1.  Therefore, subsequent code did what is was supposed too.

    Dim V_Fso, V_Success, V_Crypt, V_String
           
            Set V_Fso = CreateObject("Scripting.FileSystemObject")
            Set V_Crypt = CreateObject("Chilkat.Crypt2")
            V_Success = V_Crypt.UnlockComponent("KOSELCrypt_TUOL0nMWVf9E")
           
             V_String = V_Crypt.LastErrorText
           
            If (V_Success <> 1) Then
                MsgBox "Crypt component unlock failed"
                GoTo Done
            End If

    I don't know how to evaluate the results of:

            Set V_Fso = CreateObject("Scripting.FileSystemObject")
            Set V_Crypt = CreateObject("Chilkat.Crypt2")

    In the immediate window.




    • Edited by tkosel Thursday, July 30, 2020 10:55 PM
    Thursday, July 30, 2020 10:52 PM
  • To test in the immediate window, you can simply do

    Set V_Fso = CreateObject("Scripting.FileSystemObject")
    ? V_Fso Is Nothing

    This will return True or False indicating the CreateObject worked or not.

    Do the same for your CreateObject("Chilkat.Crypt2") statement.

    You need to use the same bitness as Access.  So if Access is 64-bit, then you need to register and user the 64-bit version of ChilkatCrypt2, 32-bit version of Access use the 32-bit version of ChilkatCrypt2.

    Also, don't forget that Office now defaults to 64-bit installations.  So your clients may not even be aware that they are actually running 64-bit and it will be incompatible with the 32-bit encryption dll.


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net





    Thursday, July 30, 2020 11:13 PM
  • Daniel.

    Thanks, I think we are getting there.  The vendor told me to install the 32 bit version of the dll.  Your hints allowed me to obtain a class registration error, which indicates to me that I have the wrong dll registered.

    I have the 32 bit version of chilkatCrypt2.dll registered, but I am using a 64 bit version of Access.

    Can you have both a 32 bit and 64 bit version of the same dll loaded?

    Will my users who have a 32 bit version of access still be able to use the db?

    Friday, July 31, 2020 9:48 PM
  • If you running x32 bit office then you must use x32 bit .dll’s.

    If you are running x64 bit office, then you must use x64 bit .dll’s.

    The OS will NOT matter.

    For a good 10 years, 99% of windows has been x64 bits.

    But, for that same good 10 years, 99% of Office installs been x32 bits.

    So, really, the OS bit size does not matter, and you don’t care.

    You ONLY care about the bit size of office – period!!!

    > Can you have both a 32 bit and 64 bit version of the same dll loaded?

    I think you mean “registered”. In this context, registered is the key concept. Loading is a different context, different idea, and something that occurs AFTER the install (registering of that .dll and software).

    > of the same dll loaded?

    Well, we should NOT call this the same .dll. You have an x32 one and an x64 bit one. So, they are thus NOT the same anymore, are they?

    What you really are asking;

    A vendor has provided me with an x64 bit version of .dll

    That same vendor has provided me with an x32 version of a .dll

    Question:

    Can I install and register both the x32 bit .dll, and the x64 bit version of the .dll?

    The answer?

    It will DEPEND on the vendor if they allow and support this.

    So, is it is possible to install (register) both versions?

    Yes, you can, but ONLY if the vendor allows this. Some don’t support such a setup.

    For example, Microsoft does NOT allow and DOES NOT support office x32 and office x64 installs on ONE computer at the same time!

    This limitation applies to a GIVEN version of office.

    Part of the reason is that MUCH of office is shared code. (Ribbon, spell check, VBA system – a HUGE part of office is shared code).

    So, if you have parts of office as x32 (say Excel and word). Then you are not allowed to install any x64 parts. And you (or Microsoft) could never really be sure what bits and parts match, and what parts do not. So, x32 software cannot consume or run x64 bit software. (and reverse is true).

    And if they did attempt this? It very problematic.

    As a result? Microsoft does not allow such a setup (mix x32 and x64 office). And the installers will PREVENT you from doing this.

    So, some vendors allow and support x32 and x64 bit version installs "side by side". Some do not.

    However:

    Is it technically possible to “register” x32 and x64 bit versions of two .dll's?

    Yes, you can. However, this will come down to vendor support.

    Keep in mind:

    There is an x64 bit version of regsvr32.

    There is an x32 bit version of regsvr32.

    So, you MUST use the correct version of regsvr32, and it will NOT work if you use the WRONG version of regsvr32 to register a .dll that does not match the bit size of regsvr32.

    So, not only do you need an x64 bit .dll, you ALSO have to be VERY (BUT VERY) sure you run the correct version of regsv32.

    (Windows will NOT make this choice for you – YOU must!!!).

    So, the match of software and .dll used has to be the same

    (x32, or x64). Of course both x32 and x64 bit software runs fine on windows x64 (it supports both systems). (they don't tell you - but you have two versions of windows software on your computer!!!!).

    And VERY carefully note this again:

    Windows does not know or chose the right version of regsv32 to use here. YOU must choose the correct version! (Or the vendor will provide you with an installer that has this choice made for you!!!).

    So, this means:

    You have an .x64 bit version of the .dll

    You use the .x64 bit version of regsvr32

    And you have an x32 bit version of the .dll

    You use the x32 bit version of regsvr32

    See the pattern here?

    The OS bit version does NOT really matter here.

    What matters is any software you use?

    Then that software MUST use and run the same bit size software – including 3rd  party add-ons and .dlls.

    So, yes, you can register both an x32 bit version and x64 bit vision of a .dll. This would be two separate and distinct uses of regsvr32. And you talking about two separate and distinct .dll’s.

    So, this is NOT the same .dll.

    Also, are you really running x64 bit office now?

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada


    • Edited by Albert D. Kallal Saturday, August 1, 2020 2:53 PM
    • Marked as answer by tkosel Tuesday, August 4, 2020 9:57 PM
    Saturday, August 1, 2020 2:42 PM
  • Mr. Kallal,

    Thanks so much for your response.  Lot of stuff there, don't know that I understand it all, but will try to work on it.

    Monday, August 3, 2020 12:10 AM
  • The gist of it is very simple:

    • x64 Office/Access requires an x64 dll
    • x32 Office/Access requires an x32 dll

    Whether you can register both really doesn't matter, considering the above, and is dependent on the vendor supporting it (so it would be case by case).

    So you have to install the appropriate dll on a case by case depending on what Office bitness is installed on each PC.



    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Monday, August 3, 2020 10:51 AM
  • Maybe its time to just dump the extra ActiveX

    Encrypting/Decrypting passwords is just an "easy" job to let it handled (and getting you in trouble) by a 3rd party ActiveX

    You can start with the "Easy" XOR and work your way with more complex data encryption/decryption : 

    https://www.di-mgt.com.au/cryptoBlowfishVer6.html

    https://stackoverflow.com/questions/8537419/ms-access-vba-substitution-cipher-encrypt-decrypt

    https://www.vbforums.com/showthread.php?862103-VB6-Simple-AES-256-bit-password-protected-encryption

    Tuesday, August 4, 2020 11:57 AM
  • For years, I have been using a Active X component named ChilkatCrypt2.dll to encrypt/decrypt passwords used in my access applications.

    You don't store passwords, never. See Plain Text Offenders - Developers FAQ.

    Tuesday, August 4, 2020 12:02 PM
  • Normally you're supposed to hash the password, never storing the actual password and then at login compare the stored hash against the submitted hashed password.

    Furthermore, you shouldn't, normally, be using a reversible hashing mechanism.  Best practice is that it should be a one way hash.  This avoids hackers being able to decrypt the password 


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Tuesday, August 4, 2020 12:42 PM
  • Albert,

    Thanks for your response.  I mistakenly ordered the 64 bit version of office on my new machine.  Uninstalled it and installed the 32 bit version and everything is fine.

    Thanks for your very complete, informative post.

    • Marked as answer by tkosel Tuesday, August 4, 2020 10:04 PM
    Tuesday, August 4, 2020 10:01 PM