|
I want to encrypt a string using MS Crypto API on Windows XP and decrypt it on Win XP OR on Win 2000. I have encrypt and decrypt code working on XP but the decrypt returns garbage on Win 2000.
I think that this is because the string was encrypted with Strong RSA, which is the default on XP, but W2K (without high security pack) does not support strong RSA. So how do I tell XP to encrypt using standard RSA, or RSA that is supported by W2K ? I have looked at the other provider types but they appear to be subsets of PROV_RSA_FULL and I'm not sure if they will work with W2K either.
The code I'm using is pretty standard:
CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0);
CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash);
|
|
|
|
|
All the samples in MSDN uses PROV_RSA_FULL, and it says on the bottom that it is supported by W2K. i've worked before with PROV_RSA_FULL, and I haven't encountered with any problems what so ever...
maybe something you do is wrong?
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Yes PROV_RSA_FULL is supported on W2K. But there were changes to the default encryption method in XP. XP now uses Strong RSA encryption and 128 bit key length. Windows 2000 used (Not Strong) RSA encryption and 40 bit key length.
The string is encrypted on XP but needs to be decrypted on Windows 2000. W2K will try to decrypt using PROV_RSA_FULL but only using a 40 bit key and this is why it fails.
Does anyone know how to force the Crypto API to use standard (NOT Strong) encryption and 40 bit encryption?
Thanks
|
|
|
|
|
Hi All
I have a property page with a tabbed property sheet, which works fine but im a bit stuck on how you get
the values back from each of the property sheets
property sheet is based on the CPropertySheet class, which is not based on CDialog but it provides the same functionality as a dialog.
i wanted to do something like the below, but when ok is called m_c_check doesnt have a value
can anyone point me in the right direction
CEmplSheet EmpSheet("Employment Application");
CEmploymentDlg Empl;
CExperienceDlg Exp;
CEducationDlg Educ;
EmpSheet.AddPage(&Empl);
EmpSheet.AddPage(&Exp);
EmpSheet.AddPage(&Educ);
EmpSheet.EnableStackedTabs(TRUE);
m_pMainWnd = &EmpSheet;
int nResponse = EmpSheet.DoModal();
if (nResponse == IDOK)
{
int i= Educ.m_c_check1.GetCheck();
}
else if (nResponse == IDCANCEL)
{
}
|
|
|
|
|
in most cases property pages reside in the property sheet class
Kuphryn
|
|
|
|
|
thanks for the reply,
but if your not going to be helpful is there any point
|
|
|
|
|
si_69 wrote: but if your not going to be helpful is there any point
If you are not going to bother to ask a correct question, you mustn't complain about the answers provided. To say that a property page contains property sheets is just nonsensical.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
hi all,
the same problem i am suffering like any thing. please provide me a solution for this which helps me a lot.
thanks,
uday.
uday kiran
|
|
|
|
|
|
I've added some bitmaps to my resources which I would like to display in buttons, but no matter if I use a CBitmap and SetBitmap or an Icon, a CImageList, I can't set the background transparent.
CImageList::Add says for crMask, "Color used to generate the mask. Each pixel of this color in the given bitmap is changed to black and the corresponding bit in the mask is set to one."
If I use that the background is really black. SetBkColor to CLR_NONE also doesn't work.
I haven't found an example on CP where the mask color is set for a button, maybe someone can help?
Thanks
Andre
|
|
|
|
|
ABuenger wrote: If I use that the background is really black. SetBkColor to CLR_NONE also doesn't work.
Make sure you are both creating the image list with a mask (ILC_MASK ) and drawing it with the proper flags (ILD_TRANSPARENT ). AFAIK, SetBkColor() only applies when you're drawing non-transparently (ILD_NORMAL ) or blending (ILD_BLEND50 ).
|
|
|
|
|
I wrote this code to send msg to MSMQ , but it did not work
can any one give me any idea to fix it,if there is something wrong ?
this is my queue -> gateway\private$\newqueue
--------------------------------
<br />
#include "stdafx.h"<br />
#include <stdio.h><br />
#include <atlbase.h><br />
#include <iostream><br />
#import <mqoa.dll><br />
using namespace MSMQ;<br />
using namespace std;<br />
<br />
void Send();<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
Send();<br />
return 0;<br />
}<br />
<br />
void Send()<br />
{<br />
IMSMQQueueInfoPtr spQInfo("MSMQ.MSMQQueueInfo");<br />
spQInfo->PutPathName(SysAllocString(OLESTR(".\\newqueue")));<br />
IMSMQQueuePtr spQSend = spQInfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE);<br />
<br />
IMSMQMessagePtr spQMsg("MSMQ.MSMQMessage");<br />
spQMsg->Label = "This is a Word Document2";<br />
spQMsg->Body = "My Boudy";<br />
spQMsg->Send(spQSend);<br />
spQSend->Close();<br />
}<br />
-- modified at 18:41 Wednesday 19th April, 2006
|
|
|
|
|
ALQallaf wrote: ...but it did not work
Which means nothing if you don't tell us which part did not work. Your code has no error checking. What does the Send() method return?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
thank you, it give me an error when i try to run it thats all (Debug Error! abnormal program termination) , i have project i have to make it
|
|
|
|
|
Thank you it has been fixed
the only things that i have trust on my self ,
the problem it was from some parametar
thanks you DavidCrow
|
|
|
|
|
Hi everybody,
First of all, i've tried to find a solution for my problem by searching with google or in other message boards but no one could help me
I am writing a Media Player, in which the user should have the posibility to change the volume of the currently playing track; BUT not the master system volume.
Iam using C++/WinAPI, no MFC...hope you can help me
PS: I use the MCI-API to implement the playback functions
... THANX A LOT!!!!!!!!!!!!
|
|
|
|
|
|
lol, and what about the Windows Media Player or VLC (see: videolan.org) ??
|
|
|
|
|
|
yea ok ok WinAmp, but check this App (it's freeware):
http://www.videolan.org/mirror.php?mirror=http://downloads.videolan.org/pub/videolan/&file=vlc/0.8.4a/win32/vlc-0.8.4a-win32.exe
i think it'S the best example that shows that there is a way to solve it....
|
|
|
|
|
i have a project i recieved which does not compile with 6 errors all relatng to :- atltime.h
i am sure the project was programmed in .net, but is there a "easy fix" to make it backward compatible with visual studio 6.
help please......
|
|
|
|
|
msgm69 wrote: i am sure the project was programmed in .net
Do you mean it was written using managed code? Then no, you can't use VC 6.
If you mean it was written in native code using VS.NET, then you'll have to change the code so it doesn't use classes that were added after VC 6.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
The CBitmapButton has a SizeToContent method which resizes the button to fit the size of the bitmap, I am looking for a way to resize a CButton to fit the size of the label.
Thanks
Andre
|
|
|
|
|