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
Crypto Plugin
46 posts
Hash Calculator based on Crypto.dll
Hash Calculator:
Example usage of Crypto plugin
Hash Calculator:
Example usage of Crypto plugin
SHA-256
Will this possibly support SHA-256 in the future?
Will this possibly support SHA-256 in the future?
Great Plugin!
Great Plugin 🙂 Is there source available for this plugin anywhere?
Great Plugin 🙂 Is there source available for this plugin anywhere?
CryptoNut
Hashing realized via Microsoft CryptoAPI, so if CryptoAPI supports such algo, this algo is supported by plugin too. SHA-1 is already supported.
{ 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]
Hashing realized via Microsoft CryptoAPI, so if CryptoAPI supports such algo, this algo is supported by plugin too. SHA-1 is already supported.
Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.
{ 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]
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:
Do you know if your check for the NTE_BAD_KEYSET as it states on this line?
Marc
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:
Do you know if your check for the NTE_BAD_KEYSET as it states on this line?
What are the chances of a new version coming out any time soon? Thanks,if (GetLastError() == NTE_BAD_KEYSET)
Marc
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.
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.
Originally posted by GAGWhen 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.
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.
SAM
Re: SHA-256
(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.
Originally posted by CryptoNuthttp :// msdn2. microsoft. com/en-us/library/ms937738.aspx
Will this possibly support SHA-256 in the future?
(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.
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
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
Here is a slightly modified version of the the one above.
CryptoAPI Plugin NEWS
Hi sag47
Thank you for you support and updated NSIS Wiki page about my plugin.
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
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
Well, the plug is broken not only on 98, but on 2000 as well.
CryptAcquireContext=0x80090016
CryptAcquireContext=0x80090016
what do you mean 'broken' ?
plugin was developed on Win2k sp4 and it works OK on many systems
plugin was developed on Win2k sp4 and it works OK on many systems
Why was this added to the Wiki?
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.
SAM
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.
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.Crypto::HashFile "MD5" "$WINDIR\notepad.exe"
Pop $0
MessageBox MB_OK $0
SAM
Originally posted by ********Provide more specs as to how you got that error. Just saying "it's broken" doesn't help with anything. I can't (or don't know how) to produce that error. Please provide the following:
Well, the plug is broken not only on 98, but on 2000 as well.
CryptAcquireContext=0x80090016
- Example of the code used to produce error
- OS and service pack version (of all systems tested on)
- user privileges on those systems
- Any other valuable information that you think would lead to producing the error and/or fixing the problem.
Thanks,
SAM
Simply launched HashCalc.exe
Windows2000 SP4
Local Administrator
No domain
Windows2000 SP4
Local Administrator
No domain
NTE_BAD_KEYSET error
Workaround for NTE_BAD_KEYSET error will be added.
Anyway I do not understand, why someone named Techtonik added to wiki article his note about mentioned error in Introduction (!!!) section. If you want to say that it doesn't work on your system, do it in Remarks section, but in Introduction, please.
Workaround for NTE_BAD_KEYSET error will be added.
Anyway I do not understand, why someone named Techtonik added to wiki article his note about mentioned error in Introduction (!!!) section. If you want to say that it doesn't work on your system, do it in Remarks section, but in Introduction, please.
Re: NTE_BAD_KEYSET error
SAM
Originally posted by GAGI don't know how to revert the history of the Wiki (hopefully you do GAG?). I've tried to figure it out with no luck. I'd prefer that the Note it will fail message in the Introduction stay out until whether or not this is a OS wide problem is figured out.
Workaround for NTE_BAD_KEYSET error will be added.
Anyway I do not understand, why someone named Techtonik added to wiki article his note about mentioned error in Introduction (!!!) section. If you want to say that it doesn't work on your system, do it in Remarks section, but in Introduction, please.
SAM
who can tell me how I can get the source code? Thanks
Who can tell me how I can get the source code?
BTW, I encountered CryptAcquireContext=0x80090016 error in one of my machines with winxp sp2.
Thanks
Who can tell me how I can get the source code?
BTW, I encountered CryptAcquireContext=0x80090016 error in one of my machines with winxp sp2.
Thanks
just gonna cross-reference a post made to a wrong thread here:
A user saw some odd behavior from the Crypto plugin, in that the Popped value appears empty, while $0 contains the actual result;
[quote]I'd guess that nothing actually gets set on the stack (as the Pop results in the Errors flag being set) and instead the Crypto plugin dumps its result in $0 directly. Not a huge issue (although not encouraged), but something that should probably be noted in the docs.[/code]
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
A user saw some odd behavior from the Crypto plugin, in that the Popped value appears empty, while $0 contains the actual result;
[quote]I'd guess that nothing actually gets set on the stack (as the Pop results in the Errors flag being set) and instead the Crypto plugin dumps its result in $0 directly. Not a huge issue (although not encouraged), but something that should probably be noted in the docs.[/code]
see sample script CryptoTest.nsi:
SubSection /e "SHA1"
Section "String Data"
SectionIn 1 2
DetailPrint "${Sep01}"
DetailPrint "SHA1 String Hash"
DetailPrint ""
DetailPrint "Crypto::HashData 'SHA1' '${HashStr}'"
Crypto::HashData "SHA1" "${HashStr}"
Pop $0
DetailPrint "Result:"
DetailPrint "String: '${HashStr}'"
DetailPrint "SHA1: [$0]"
DetailPrint ""
SectionEnd
GAG:
Throws the Pop error messagebox, and the 2nd messagebox shows that $1 still reads "D1", while $0 shows the MD5 hash.
StrCpy $0 "D0"
StrCpy $1 "D1"
Crypto::HashFile "MD5" "$WINDIR\notepad.exe"
ClearErrors
Pop $1
${If} ${Errors}
MessageBox MB_OK "Pop error!"
${EndIf}
MessageBox MB_OK "[$0][$1]"
CryptAcquireContext=0x80090016Here is an MSDN article that describes the CryptAcquireContext error codes.
Thought that would help with further development. Specifically with that error:
NTE_BAD_KEYSET (0x80090016)
- Key container does not exist.
- You do not have access to the key container.
- The Protected Storage Service is not running.
I got CryptAcquireContext=0x80090016 error on 3 of 5 machines with Win XP SP3.
The errors can be shown just by HashCalc.exe.
Is there some workaround?
The errors can be shown just by HashCalc.exe.
Is there some workaround?
Crypto plugin has a bug. It's 100%.
So I've replaced it by MD5 plugin
So I've replaced it by MD5 plugin
Thanks for posting an alternative. The source appears to be lost for the Crypto Plugin so I don't know if the bug will ever be fixed. I'm not the original creator.
Broken plugin
This plugin fails for me on Windows 7 using the provided 'HashCalc' example. The error NTE_BAD_KEYSET (0x80090016) is given. I built the installer and also tested the resulting HaskCalc on Windows XP and I get the same error.
So I conclude that something might have changed in Windows Crypto and this plugin for NSIS is now completely unusable unless someone works out how to fix it.
Update: it may be that users outside the United States see this error only, if this is something to do with the plugin depending on a hobbled version of some Windows DLL that doesn't provide the required functionality...?
This plugin fails for me on Windows 7 using the provided 'HashCalc' example. The error NTE_BAD_KEYSET (0x80090016) is given. I built the installer and also tested the resulting HaskCalc on Windows XP and I get the same error.
So I conclude that something might have changed in Windows Crypto and this plugin for NSIS is now completely unusable unless someone works out how to fix it.
Update: it may be that users outside the United States see this error only, if this is something to do with the plugin depending on a hobbled version of some Windows DLL that doesn't provide the required functionality...?
Updated Crypto Plugin 1.2
Well...
More then 9 years ago after release of original Crypto Plugin in 2004...
After loosing original sources...
New release!
Crypto Plugin 1.2 build 1030
1.2 - November 25, 2013
Download
Archives attached.
Alternative download links:
P.S. Opened this forum after last message about Winamp.com and Winamp Media players death. Someone got complete winamp.com archive?
Well...
More then 9 years ago after release of original Crypto Plugin in 2004...
After loosing original sources...
New release!
Crypto Plugin 1.2 build 1030
1.2 - November 25, 2013
- Fixed CryptAcquireContext NTE_BAD_KEYSET (0x80090016) and NTE_KEYSET_ENTRY_BAD (0x8009001A) errors
- Technical note: original Crypto.dll was unpacked and patched (CryptAcquireContext call parameters patched; corresponding relocation records removed; version information updated)
Download
Archives attached.
Alternative download links:
- Crypto Plugin 1.2 build 1030: cryptoplg12.zip 10.3 KB, no installer
- Crypto Hash Calculator::Crypto Plugin Test: hashcalc12.zip 31.2 KB, no installer
P.S. Opened this forum after last message about Winamp.com and Winamp Media players death. Someone got complete winamp.com archive?
There is a copy of this NSIS sub forum but I'm guessing nobody has a copy of all Winamp skins and plugins if that is what you mean...