Objective-C加密 [英] Encryption for Objective-C

查看:171
本文介绍了Objective-C加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Web服务从Objective-C发送加密数据到远程服务器。我应该使用什么加密方法?它应该支持Objective-C和远程服务器。

I need to send encrypted data to a remote server from Objective-C using a web service. What encryption method should I use? It should support both Objective-C and the remote server.

推荐答案

CommonCryptor.h是iPhone上C加密的标题。它支持以下算法:

CommonCryptor.h is the header for C encryption on iPhone. It supports the following algorithms:

kCCAlgorithmAES128,
kCCAlgorithmDES,        
kCCAlgorithm3DES,       
kCCAlgorithmCAST,       
kCCAlgorithmRC4     

如果您在MacOS上有CommonCrypto加上所有的OpenSSL选项。我不知道这些类的Objective-C包装,但是CommonCrypto是非常简单的,因为加密。

If you are on MacOS you have CommonCrypto plus all the OpenSSL options. I do not know of an Objective-C wrapper for these classes, but CommonCrypto is fairly simple as encryption goes.

这些算法是很常见的,你不应该有查找一个实现的麻烦,不管服务器平台如何。如果您没有任何令人信服的理由选择其他算法,AES是一个合理的选择。

Those algorithms are all common enough that you should not have any trouble finding an implementation, regardless of the server platform. If you have no compelling reason to choose another algorithm, AES is a reasonable pick.

编辑:

对此类似问题的回答建议使用SSCrypto作为OpenSSL的Objective-C包装器。

An answer to this similar question suggested SSCrypto as an Objective-C wrapper for OpenSSL.

这篇关于Objective-C加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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