gpt4 book ai didi

c++ - 在 C 代码中安全地嵌入字符串(Secure string、Secure char*)

转载 作者:太空宇宙 更新时间:2023-11-04 05:13:30 25 4
gpt4 key购买 nike

我有一个定义了一些字符串的 dll (ansi c)。

__declspec(dllexport) char* GetSomeString()
{
return "This is a test string from TestLib.dll";
}

编译后这个字符串在“记事本”中仍然可见。我是 C 的新手,所以我想知道,有没有一种方法可以安全地存储字符串文字?

我应该使用具有一些加密值的 resx 文件(例如),还是最好的方法?

谢谢


编辑 1:该场景基本上是以下伪代码: 如果(主机名) 返回主机名 别的 返回“文字字符串”';

我希望以某种方式“保护”这个“文字字符串”..

最佳答案

如果您希望保密,请不要将您的 secret 放在任何其他人的计算机上。

参见我的相关回答,The #1 Law of Software Licensing

Eric Lippert's similar answer

关于c++ - 在 C 代码中安全地嵌入字符串(Secure string、Secure char*),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20128652/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com