Home >Backend Development >PHP Tutorial >c++ 加密程序用php怎么写?

c++ 加密程序用php怎么写?

WBOY
WBOYOriginal
2016-06-06 20:47:521228browse

<code>#define C1 34783
#define C2 55419
CString Encrypt(CString S, WORD Key) // 加密函数
{
    CString Result,str;
    int i,j;
    Result=S; // 初始化结果字符串
    for(i=0; i<s.getlength i result.setat s.getat>>8)); // 将密钥移位后与字符异或
        Key = ((BYTE)Result.GetAt(i)+Key)*C1+C2; // 产生下一个密钥
    }
    S=Result; // 保存结果
    Result.Empty(); // 清除结果
    for(i=0; i<s.getlength i j="(BYTE)S.GetAt(i);" str="12" str.setat result return></s.getlength></s.getlength></code>

这个问题已被关闭,原因:

回复内容:

<code>#define C1 34783
#define C2 55419
CString Encrypt(CString S, WORD Key) // 加密函数
{
    CString Result,str;
    int i,j;
    Result=S; // 初始化结果字符串
    for(i=0; i<s.getlength i result.setat s.getat>>8)); // 将密钥移位后与字符异或
        Key = ((BYTE)Result.GetAt(i)+Key)*C1+C2; // 产生下一个密钥
    }
    S=Result; // 保存结果
    Result.Empty(); // 清除结果
    for(i=0; i<s.getlength i j="(BYTE)S.GetAt(i);" str="12" str.setat result return></s.getlength></s.getlength></code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn