模糊处理/随机化的字符串字符串、模糊、随机化

由网友(同桌是个智障)分享简介:我怎么会去混淆文本,这是无法读取用户读取文本文件,但我的程序仍然可以看了吗?基本上,我将不得不像真*真*假*真*假*假*假*真*假*真实* 在文本文件中,我需要的是所有疯狂的寻找。 我知道如何从文件中的文本和写文件和所有的东西,我只需要弄清楚如何进行模糊处理字符串和去混淆了。这是可能的,而不进入都疯了加密的东西?我认为...

我怎么会去混淆文本,这是无法读取用户读取文本文件,但我的程序仍然可以看了吗?基本上,我将不得不像真*真*假*真*假*假*假*真*假*真实* 在文本文件中,我需要的是所有疯狂的寻找。

我知道如何从文件中的文本和写文件和所有的东西,我只需要弄清楚如何进行模糊处理字符串和去混淆了。这是可能的,而不进入都疯了加密的东西?我认为,AES等加密方法是矫枉过正,因为在我的计划,这个信息是不是绝密什么的,可以在程序反正查看。我只是不希望它通过文件直接编辑。

感谢一大堆:D

解决方案   

这是可能的,而不进入都疯了加密的东西?

当然,但如果用户甚至可以远程知道自己在做什么,他就可以去code就没有问题。

  // EN code
VAR字节= Encoding.UTF8.GetBytes(真*假*真);
变种的base64 = Convert.ToBase64String(字节);

//德code
VAR数据= Convert.FromBase64String的(Base64);
VAR德codedString = Encoding.UTF8.GetString(数据); //获取字符串,而不是字节,感谢比喻
 

How would I go about obfuscating text so it's unreadable to a user reading a text file, but my program could still read it? Basically, I'm going to have something like True*True*False*True*False*False*False*True*False*true* in a text file, and I need it to be all crazy looking.

mysql模糊查询1,11,111用逗号拼接的相似字符串

I know how to get the text from the file and write to the file and all that stuff, I just need to figure out how to obfuscate the string and de-obfuscate it. Is this possible without getting into all crazy encryption stuff? I think AES and other encryption methods are overkill because in my program, this info isn't top secret or something, it can be viewed in the program anyways. I just don't want it edited directly through the file.

Thanks a bunch :D

Nathan

解决方案

Is this possible without getting into all crazy encryption stuff?

Sure, but if user even remotely knows what he's doing he will be able to decode it with no problem.

// Encode
var bytes = Encoding.UTF8.GetBytes("true*false*true");
var base64 = Convert.ToBase64String(bytes);

// Decode
var data = Convert.FromBase64String(base64);
var decodedString = Encoding.UTF8.GetString(data); // get string and not bytes, thanks trope

阅读全文

相关推荐

最新文章