06-12-2009 09:05 AM
06-12-2009 11:57 AM
Jippi!!!
That actually works!! Thanks a lot!!
05-09-2011 07:50 PM
May I know how to decrypt a encrypted file, which using DES algorithm?
Here are my coding, got error when create the DES service provider.
System_IO_MemoryStream__Create_2 (&ms, (unsigned char *)input, 15920, NULL);
System_IO_MemoryStream_WriteTo (ms, stream, NULL);
err = System_Security_Cryptography_DESCryptoServiceProvider__Create(&des, NULL);
err = System_Security_Cryptography_DESCryptoServiceProvider_Set_Key(des, key, 13, NULL);
err = System_Security_Cryptography_DESCryptoServiceProvider_CreateDecryptor_1(des, &transform, NULL);
err = System_Security_Cryptography_CryptoStream__Create(&cs, stream, transform, 0x0, NULL);
System_Security_Cryptography_CryptoStream_Read (cs, &output, &x, 0, 15920, &outputLen, NULL);
05-10-2011 05:07 PM
Hi moonlotus,
Did this produce a specific error code and/or message along with it? Having that could be helpful in resolving the issue. Also, just to clarify, are these functions that you have written yourself, or are they from a library? Thanks!
05-10-2011 07:32 PM
These functions are from .NET library, I import "mscorlib.h".
I get error = -6571, which refers to
CDotNetInvocationTargetError
The target invoked by the LabWindows/CVI .NET Library threw an exception.
(source:http://zone.ni.com/reference/en-XX/help/370051H-01/cvi/cvidotnet_library_error/)
I can't find other example which is availabe in CVI, thus refering the coding from MSDN, DESCryptoServiceProvider
05-11-2011 05:12 PM
Hi moonlotus,
Is this error definitely coming from the create step in your code, or is this the final value of "err" after execution? One thing you could try, if you look at the function panel for the System_Security_Cryptography_DESCryptoServiceProvider__Create() function, if you declare an Exception Handle, rather than using NULL, you can get more information from the exception that is thrown by using the CDotNetGetExceptionInfo() function. If you right-click on the Exception Handle in the function panel, you can see more information about to do this. Hope this helps!
06-22-2011 10:06 PM
Thanks for your reply.
May I know where can I find the Crypt32.Lib? I'm using CVI 9.0.
06-23-2011 06:45 AM
It should be found in c:\program files\National Instruments\CVIxx\sdk\lib folder; I don't know if this library is included in every CVI distribution.
06-23-2011 10:03 PM
I'm using CVI 9.0, but I do not have this file.
I got it after installing Microsoft Platform SDK.
Thanks.