|
Hi,
I wanted to use 3DES encryption in my C++/VC++ code for encypting an XML string. Could anyone please point me to some open source library which I could use directly instead of developing it all over again.
Thanks in advace.
|
|
|
|
|
You don't need a open source library, Windows has Cryptography API [^] providing triple DES algorithm.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
How to specify 3DES while using EncryptMessage() API. Could you please share the code snippet if you have one.
|
|
|
|
|
See, for instance [^], the encryption algorithm is specified in the CryptGenKey call.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I'd recommend Crypto++[^]. I find (once you're used to the way it works) that it's easier to use than Windows Cryptographic APIs.
Jeffrey Walton's written quite a few very useful articles[^] on cryptography, using Crypto++ and (IIRC) the Windows Cryptographic API
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hey,
i'm working with a function which creates a base 64 hash of a string which i enter, and then another function which verifies if the hashed data is the same as the original string. (yup its CAPICOM again ). the problem is that the sign and verify functions return _bstr_t data types and accepts UNICODE style data only. so im signing data using the sign function (which wants and returns _bstr_t type string) and then i verify it (again returns a bstr_t type) but it fails at verifying. i googled it a lot and someplaces say its because CAPICOM only works with UNICODE data. so my question: how do i pass in the bstr_t string as a UNICODE?
edit: I guess I misinterpreted the displayed value of 0...
|
|
|
|
|
Well, bstr_t encapsulates BSTR strings, that, roughly speaking are OLECHAR * , finally OLECHAR are WCHAR , i.e. wide char. The point is: bstr_t represent a UNICODE string so, what is your problem? Could you please post the relevant code?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
lol u asked for it i don't know how familiar you are with the CAPICOM functions but this is bascially the code and below is what i want the outcome to be:
<pre>
CAPICOM::ISignerPtr signer(__uuidof(Signer));
CAPICOM::ISignedDataPtr sigData(__uuidof(SignedData));
sigData->Content = "Data to Sign";
_bstr_t sigStr = sigData->Sign(signer,true,CAPICOM_ENCODE_BASE64);
cout<<"\n\nVerified String: "<<sigData->Verify(sigStr, true, CAPICOM_VERIFY_SIGNATURE_ONLY)<<endl;
</pre>
This code sets the content to be signed to "Data to Sign", and creates a hash with the signer's private key(can be displayed by cout<<sigStr;). in Verify function it should (it does in java) display the decrypted string (i.e "Data to Sign" on the console, whereas I'm getting a 0 on my end ). I read the article http://www.codeproject.com/KB/security/CapicomUTF8.aspx and it mentioned that fact that it wants unicode. uh... hope that helps you figure out what i'm trying to say...
|
|
|
|
|
sadman89 wrote: sigData->Content = "Data to Sign";
Why don't you use
sigData->Content = bstr_t(L"Data to Sign");
?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ok i tried that (and _bstr_t(..)) still the verification is displaying a 0 i guess the cast(?) is fundamentally correct, but its still not giving me the expected output. I also looked at the excellent http://www.codeproject.com/KB/string/cppstringguide2.aspx for some new ideas but no luck darn this COM and the lack of help from Microsoft
modified on Monday, June 22, 2009 4:01 AM
|
|
|
|
|
Can anyone explain how to change the forms and other controls are look and feel (Runtime) in vc++?
|
|
|
|
|
Hi suthakar,
You can call the ModifyStyle or ModifyStyleEx to update ur window styles dynamically.
Alternative is to use the SetWindowLong family of functions (as documented in MSDN)
to change the style byte values, and update the window accordingly.
Just be sure that your style values are compatible with the way ur using ur dialogs/forms.
|
|
|
|
|
Hi Tyrion,
Thanks for your information.Extented that shall i add themes like office2007 styles or VISTA styles to dialogs and forms?Is there any provision for adding those themes?
|
|
|
|
|
You need to customize your control (WM_OWNERDRAW) you can find examples for each control on the codeproject.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
yup i agree with hamid, WM_OWNERDRAW gives u full control over the drawing operations.
and sorry but i`m not too familiar with the newer Vista and Office 2007 styles
|
|
|
|
|
Hi all,
i want to use scheduler in my application.
i want to show a message on scheduled time,the scheduler should have feature of repeatition like hourly,everyday,weekly,monthly etc.
please expalin me how can i use it?
if possible please explain me with example .
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
|
|
Hi, I would like to know where can I find sample C++ application that can be vulnerable to attacks like buffer overflow, format string, intefer overflow ..etc...so that they will pron to Denial of service. I know what mistakes leads to these vulnerabilities but I would like to know how it will be applicable in terms of client / server technology (e.g. Web vulnerabilities). How an attacker can cause above mentioned attacks in C++ application. I would like to know the scenarios in C++ application. If anyone know this will be helpful.
Thanks
SNI
|
|
|
|
|
|
Thanks for ur reply. This will give me what kind of attacks that C++ application can be vulenerable to but i want the scenario (C++ application) where these vulnerabilities can happen so I can simulate them in a programmed manner.
Thanks
SNI
|
|
|
|
|
Hello,
I have created a child window using CreateNewChld function
CMDIChildWnd* ChildPt = pFrame->CreateNewChild(RUNTIME_CLASS(TableFrame),TITLE_Production, m_hMDIMenu, NULL);
TableFrame* pF = STATIC_DOWNCAST(TableFrame,ChildPt);
pF->FrameInit(PRODUCTION,FontVector2,true);
The window is created using the class TableFrame but the mouse clck messages are not diverted to the the TableFrame class . Why is that so?
When I click the minimize,maximize buttons of the window the OnSize() of TableFrame is called
Pritha
|
|
|
|
|
When i tried to create a Dialog class (vc++ 6), it gives an error called" Unable to open the files TestDialog.h and TestDialog.cpp" ( project name:Test)
i am getting the same error even creating a new class using class wizard.
i donot know how to clear this error.
|
|
|
|
|
It could be possible that some of the files needed by the class wizard like .clw could be read-only.
Ensure all files have write access and try again.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
That is a known ClassWizard error. It can usually be ignored, however. You might try closing Visual Studio, deleting the temporary files (e.g., opt, ncb, clw, aps, pch), and then re-opening the project.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|