www.pudn.com > CraftFTP_gb.rar > Crypt.cpp
// Crypt.cpp: implementation of the CCrypt class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "craftftp.h"
#include "Crypt.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CCrypt::CCrypt()
{
}
CCrypt::~CCrypt()
{
}
CString CCrypt::Encrypt(CString str)
{
char *key=new char[strlen("NEWMOONSOFT1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ")+1];
strcpy(key,"NEWMOONSOFT1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ");
int pos=str.GetLength()%strlen(key);
CString ret;
for (int i=0;i