std::string Encrypt(std::string content, std::string secretKey)
{
    for (UINT i = 0; i < content.length(); i++)
    {
        content[i] ^= secretKey[i % secretKey.length()];
    }
 
    return content;
}
 
std::string Decrypt(std::string data, std::string secretKey)
{
    for (UINT i = 0; i < data.length(); i++)
    {
        data[i] ^= secretKey[i % secretKey.length()];
    }
 
    return data;
}
版权声明:本博客文章与代码均为学习时整理的笔记,文章 [均为原创] 作品,转载请 [添加出处] ,您添加出处是我创作的动力!










