在ObjC / C中隐藏/加密字符串的最佳方式是什么? [英] What is the best way to hide/encrypt a String in ObjC/C?

查看:128
本文介绍了在ObjC / C中隐藏/加密字符串的最佳方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的代码中有一个字符串,当我与我的服务器进行通信时,我使用一个秘密。通过搜索我的二进制文件或在运行时查看内存,最好的方法是剔除这个字符串,以确保黑客无法找到它。 (如果可能的话可以防止)

I have a string in my code that I use as a secret when I communicate with my server. What is the best way to encypt this string to ensure that a hacker will not be able to find it out by searching my binary or looking into the memory during run time? (if possible to prevent at all?)

你会建议哪些措施至少使其成为diffcult?

What are some measures you would suggest to at least make this as diffcult as possible?

推荐答案

一个更好的方法是监视您的服务器的使用情况,并尝试检测与您的应用程序不匹配的使用模式,例如知道它总是会产生一种的请求,或者您作为参数传递给呼叫的iPhone ID没有从多个来源过度使用。当应用程序首次启动并在服务器上记录电话号码以允许其他电话时,您可以使其初始呼叫。

A far better approach would be to monitor use from your server and try to detect usage patterns that did not match your application - such as knowing it would always make one kind of request before another, or that an iPhone ID you pass up as a parameter to a call was not used excessively from multiple sources. You could have it make an initial call when the app first starts and record on the server the phone ID to allow other calls.

有多种方法可以解决问题,但它们都是基于服务器的 - 客户端中的任何东西都可以被黑客看到。客户说的任何事情都必须被视为谎言,有时候会被当作谎言。

There are multiple ways to approach the problem, but they are all server based - anything in the client can and will be seen by a hacker. Anything the client says must always be treated as a lie, for sometimes it will be.

这篇关于在ObjC / C中隐藏/加密字符串的最佳方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆