Announcement

Collapse
No announcement yet.

Crypto Plugin

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Crypto Plugin

    Introduction


    This plugin provides you cryptographic interface using CryptoAPI.
    Using this plugin you can get common cryptographic hashes like MD5, SHA1, MD2, MD4.

    Plugin DLL size: 3 660 bytes (not packed), 2 886 bytes (upx packed)


    How to use

    1. Hash of string

    Crypto::HashData "MD5" "String to be hashed"
    Pop $0


    Supported algorithms: MD5|SHA1|MD2|MD4

    2. Hash of file

    Crypto::HashFile "MD5" "$WINDIR\notepad.exe"
    Pop $0


    Supported algorithms: MD5|SHA1|MD2|MD4

    Examples

    Hash Calculator: HashCalc.nsi
    Simple test: CryptoTest.nsi
    Attached Files
    Last edited by GAG; 5 May 2004, 07:47.

  • #2
    Hash Calculator based on Crypto.dll

    Hash Calculator:
    Example usage of Crypto plugin
    Attached Files

    Comment


    • #3
      SHA-256

      Will this possibly support SHA-256 in the future?

      Comment


      • #4
        Great Plugin!

        Great Plugin Is there source available for this plugin anywhere?

        Comment


        • #5
          CryptoNut
          Hashing realized via Microsoft CryptoAPI, so if CryptoAPI supports such algo, this algo is supported by plugin too. SHA-1 is already supported.

          Gain technical skills through documentation and training, earn certifications and connect with the community


          { truparu }
          Thank you!
          Yep, source will be available, when I'll rewrote it from scratch coz I lost my sources [no backup while crash... as always]

          Comment


          • #6
            CryptAcquireContext error 0x80090016

            I've used this dll on my development system without a problem. But when I run the installer on some other systems, I get a CryptAcquireContext error 0x80090016.

            I did a bit of digging and found this:
            Microsoft support is here to help you with Microsoft products. Find how-to articles, videos, and training for Microsoft 365 Copilot, Microsoft 365, Windows, Surface, and more.


            Do you know if your check for the NTE_BAD_KEYSET as it states on this line?

            code:
            if (GetLastError() == NTE_BAD_KEYSET)
            What are the chances of a new version coming out any time soon? Thanks,

            Marc

            Comment


            • #7
              Hi, Marc
              I know about CryptAcquireContext error 0x80090016
              It's not related to link you posted.
              I used enhanced crypto provider instead of basic one. On some OS enhanced version isn't installed (due to old stupid export limitations or on Win98 w/o IE6 with strong crypto support)
              New version of this plugin will be published when I rewrote it from scratch
              as i already said in prev post, I lost my sources.

              Comment


              • #8
                Originally posted by GAG
                Hi, Marc
                I know about CryptAcquireContext error 0x80090016
                It's not related to link you posted.
                I used enhanced crypto provider instead of basic one. On some OS enhanced version isn't installed (due to old stupid export limitations or on Win98 w/o IE6 with strong crypto support)
                New version of this plugin will be published when I rewrote it from scratch
                as i already said in prev post, I lost my sources.
                When you rewrite it can you include support for Whirlpool algorithm possibly? Also your installer puts the documentation in the wrong place. It goes in NSISDIR/Docs/Crypto and the source code (when you rewrite it) should go in NSISDIR/Contrib/Crypto.
                SAM

                Comment


                • #9
                  Re: SHA-256

                  Originally posted by CryptoNut
                  Will this possibly support SHA-256 in the future?
                  http :// msdn2. microsoft. com/en-us/library/ms937738.aspx
                  (had to link this way because now this forum has some dumb link approval system)

                  Take out the spaces and you'll have your link.
                  That is all of the supported hash algorithms supported by the CryptAPI.

                  I've also added a link in the plugin's wiki page on nsis.

                  Comment


                  • #10
                    Hi GAG,
                    Hopefully this little snippet will help you rewrite your code faster. Here is a code example I downloaded from another community I belong to that uses the CryptoAPI.
                    SAM
                    Attached Files

                    Comment


                    • #11
                      Here is a slightly modified version of the the one above.

                      Comment


                      • #12
                        CryptoAPI Plugin NEWS

                        Hi sag47

                        Thank you for you support and updated NSIS Wiki page about my plugin.

                        When you rewrite it can you include support for Whirlpool algorithm possibly?
                        Whirlpool isn't included in any CrypoAPI implementation, so it can be implemented only using non-CryptoAPI method. If you can explain why Whirlpool is better than SHA-256|512, I'll try to add this algo.

                        Also your installer puts the documentation in the wrong place.
                        ok, will be placed in accordance to NSIS folder structure

                        That is all of the supported hash algorithms supported by the CryptAPI.
                        just check ALG_ID at MSDN and you'll see this note above CALG_SHA_256:
                        Windows XP and Windows 2000/NT:: This algorithm is not supported.

                        the only way to include support for SHA >=256 bits is to create a CryptoAPI-independent implementation which will increase plugin size (I do not really care about disk space anymore

                        well, I'll try to find more time now to implement some of your wishes

                        P.S. url tag needs to be approved? (see above)
                        P.P.S. ALG_ID at MSDN: http://msdn2.microsoft.com/en-us/library/aa375549.aspx

                        Comment


                        • #13
                          Well, the plug is broken not only on 98, but on 2000 as well.

                          CryptAcquireContext=0x80090016

                          Comment


                          • #14
                            what do you mean 'broken' ?
                            plugin was developed on Win2k sp4 and it works OK on many systems

                            Comment


                            • #15
                              Why was this added to the Wiki?
                              code:
                              Note that it will likely to fail with CryptAcquireContext=0x80090016 error on systems prior to WinXP.

                              At the moment there doesn't appear to be sufficient research to indicate this problem with the exception of one person whose configuration could itself possibly be broken.

                              I just tested the cryto 1.1 with the following script test using NSIS v2.34 on Windows 2000 SP4 user privileges only.
                              code:
                              Crypto::HashFile "MD5" "$WINDIR\notepad.exe"
                              Pop $0
                              MessageBox MB_OK $0

                              The message returned was null and no hash was return yet I didn't get the error like the user above specified so I think before the wiki is edited that further testing is required.
                              SAM

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎