|
/********************************************************************
Created: 27/3/2004, 21:35
File name: D:\Projects\Exile\Exile\security.h
File path: D:\Projects\Exile\Exile
File base: security
File ext: h
Author: Gogolev Anton
*********************************************************************/
#ifndef __SECURITY_H__
#define __SECURITY_H__
#include "typedefs.h"
#include "../MD5/MD5.h"
// Generates private key of a given key length (which is in bits)
// using User Name and Password
void GeneratePrivateKey(CString &rstrUserName, CString &rstrPassword, int nKeyLength, KEYINFO &rKeyInfo);
// Generates "User name + Master Password" hash
void GeneratePasswordHash(CString &rstrUserName, CString &rstrPassword, MD5HASH &rhsPassword);
// Generates a password of a given length using a given character set and a buffer of DWORDs
// pszPassword must be allocated by caller.
void GeneratePassword(TCHAR *pszCharSet, int nCharSetLength, DWORD *pdwData,
int nDataLength, int nPasswordLength, TCHAR *pszPassword);
// Frees a buffer of a given length, erasing its contents before
// releasing it to a memory manager
void FreeBuffer(void *pBuffer, size_t sBuffer);
// Just cleans a buffer
void CleanBuffer(void *pBuffer, size_t sBuffer);
// Cleans a string
void CleanString(CString &rstrS);
#endif //__SECURITY_H__
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here