|
Use MD5 encryption. A lot of free C++ libraries provides it, for example here.
Tip: you shouldn't decrypt the password . Instead, in the authentication module, retrieve a password from user, encrypt it by MD5 and compare it with the saved (encrypted) password.
Robert-Antonio
"CRAY is the only computer, which runs an endless loop in just 4 hours"
|
|
|
|
|
Robert A. T. Káldy wrote:
Tip: you shouldn't decrypt the password . Instead, in the authentication module, retrieve a password from user, encrypt it by MD5 and compare it with the saved (encrypted) password.
Yes, that would be the standard way to do it, but the whole point is that I don't want to retrieve a password from the user. I want them to be able to save their password so that it just logs them in after decrypting their saved password. Also, the authentication module is a third party solution, and it expects the password in plain text. Thanks for the input, any other ideas?
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
|
Hmmmm...if you want to save the passwords in a form, which can be algorithmically decrypted, it isn't more secure, that saving it in plaintext . If you only want BFU not to read the saved passwords in Notepad, you should use ROT13. It simply rotates the letters by 13 (A->N, B->O etc.). Or use a Vigenere cipher (see here).
Robert-Antonio
"Science is a differerntial equation.
Religion is a boundary condition."
|
|
|
|
|
Dear All,
The below is a part of my function, i would be updated my access file through CRecordSet class with using SQL command. But it seem like not work.
any problem occour? Do you think the datatpye inside the access file will lead abnormal termination ?
//-------------------------------------------------------------------------
// Name: updateRecord()
// Desc: update the database content into the list box
// modified by Anson on 3/3/04
//--------------------------------------------------------------------------
static void updateRecord(HWND hwnd, CDatabase *db)
{
sprintf(str, "UPDATE PlantInit SET %s = %s WHERE FrameID = %s" ,g_plantDataField[i],ebstr,g_temp[j].frameID);
// Open database my write my DQL command on it
rsta.Open(CRecordset::dynaset, str );
MessageBox(hwnd, "The record has been updated.", "Database Message", MB_OK);
rsta.Close();
}
Regards,
Anson Tong
|
|
|
|
|
Hi,
You should use try{} and catch{} statements and _com_error exception to get full explanation what's wrong in your code.
Sincerely Yours,
RadioShark
|
|
|
|
|
No error checking? If you are using MFC, use a CString object instead of sprintf() . Something like:
static void updateRecord(HWND hwnd, CDatabase *db)
{
CString str;
str.Format("UPDATE PlantInit SET %s = %s WHERE FrameID = %s" ,g_plantDataField[i], ebstr, g_temp[j].frameID);
TRY
{
rsta.Open(CRecordset::dynaset, str);
rsta.Close();
AfxMessageBox("The record has been updated.");
}
CATCH(CDBException, pDBException)
{
AfxMessageBox(pDBException->m_strError);
}
END_CATCH
}
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I keep getting this assertion when terminating a vb app that I'm using to call a c++ dll that I made using mfc. Anyone know what I'm doing wrong?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
You're probably passing crud to delete or free somewhere in your DLL. Check anywhere you do malloc/new that you're eventually calling free/delete (and only once!).
You must not use malloc or new and then pass the allocated thing back to VB, since it can't deal with it correctly (and certainly won't be able to free it properly).
Steve S
|
|
|
|
|
the function is declared as an int and is either returning a 1 or a 0 to vb to indicate failure or success. In VB I have it declared as a long. Could that be the problem?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Unlikely. In that case the value is being passed back directly in a register.
Your function should be __stdcall, as opposed to __thiscall or __cdecl, but it almost certainly is, or you'd get a different error
Steve S
|
|
|
|
|
this is the error I'm getting in the debug info in my dll:
HEAP[Project1.exe]: Invalid Address specified to RtlFreeHeap( 1150000, 12046d0 )
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Pretty much as I suspected, then.
There are a few causes of this:
o This could be freeing memory twice (more common than you'd expect!)
o Using malloc/new, then altering the pointer before calling free/delete.
o Block overrun (writing past the allocated buffer)
o Accessing memory after freeing it
Also, you might want to read PSS 190799 in the MSDN KB for what you can't pass around via DLLs.
Can you do a debug build of your DLL, and run VB via the debugger or use DBMON/DebugView to see the debug output? It might provide more information...
Steve S
|
|
|
|
|
Hi all,
I am using AddItem() to add tabs to a CTabCtrl but don't know how to actually add content to each tab. Can I just design dialogs or PropPages from the resources and load them into a tab?
Mark
|
|
|
|
|
|
How do I use rand() with a button to display the random number in an edit box. I know its a simple question but I'm new to C++. please help.
|
|
|
|
|
Hi,
it is very easy. Have you discovered MSDN?
Sincerely Yours,
RadioShark
|
|
|
|
|
thank rdioshark I'll have a look. microsoft developers network right? will it help a newbie like me?
nicolas
|
|
|
|
|
nicolas thompson wrote:
will it help a newbie like me?
A tool is what you make of it. Whether it helps you or not can only be determined by you. Others can offer their perspective but the deciding factor is solely yours. Enjoy!
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Are you wanting help with the button-click event, or the updating of an edit box?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
The button-click event.
Thanks very much in advance David.
nicolas
|
|
|
|
|
Handle the BN_CLICKED message. If you are using MFC, use ClassWizard (Ctrl+W) to create a ON_BN_CLICKED() handler.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I'using Borland C++ builder 4.0. I've got a button which Ive called btnGenerate an edit box called editA. I want to generate a number in the edit box between 0-9 on the click event of the generate button. Are you familiar with the borland C++ builder. I'm not sure I've heard of the MFC.
Many thanks nicolas.
|
|
|
|
|
Anonymous wrote:
Are you familiar with the borland C++ builder.
I've not used a Borland product in over a decade. Sorry.
Anonymous wrote:
I'm not sure I've heard of the MFC.
It's part of Microsoft Visual C++, the main topic of this board.
Anonymous wrote:
I want to generate a number ... between 0-9
When you are ready for it, here's the code:
int x = rand() % 10;
|
|
|
|
|
I'using Borland C++ builder 4.0. I've got a button which Ive called btnGenerate an edit box called editA. I want to generate a number in the edit box between 0-9 on the click event of the generate button. Are you familiar with the borland C++ builder. I'm not sure I've heard of the MFC.
Many thanks nicolas.
|
|
|
|
|
Hi all,
I have created a DLL from some C++ code (to call from my C# app).
The DLL creates and writes to a couple of files.
However, it writes them to the folder last used by the C# app.
1. Why? (Less important)
2. How do I specify where to write the file, relative to the DLL file. (More Important)
Thanks in advance for any suggestions/hints.
J
---
|
|
|
|