任何可可源代码为AES加密解密? [英] Any cocoa source code for AES encryption decryption?

查看:148
本文介绍了任何可可源代码为AES加密解密?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在搜索AES加密上的一些可可码,我做了一些谷歌搜索。我发现这个非常有用的链接 -
http://iphonedevelopment.blogspot.com/2009/02/strong-encryption-for-cocoa-cocoa-touch.html 。所以我尝试了它,但它并没有为我工作。

I am searching for some cocoa code on AES encryption and I did some google search for it. I found this very useful link - http://iphonedevelopment.blogspot.com/2009/02/strong-encryption-for-cocoa-cocoa-touch.html. So I tried it but it did not work for me.

任何人都可以建议我一些有用的链接或源代码,可以帮助我在我的示例应用程序中实现它。 / p>

Can anyone suggest me some useful link or source code which can help me to implement it in my sample application.

推荐答案

AES128加密在iPhone上可用于CommonCrypto框架。相关功能在CommonCryptor.h标题中。

AES128 encryption is available on the iPhone in the CommonCrypto framework. The relevant functions are in the CommonCryptor.h header.

您可以像这样创建一个cryptor:

You can create a cryptor like so:

// Assume key and keylength exist
CCCryptorRef cryptor;
if(kCCSuccess != CCCryptorCreate(kCCEncrypt, kCCAlgorithmAES128, 0, key, keyLength, NULL, &cryptor))
  ; //handle error

// Repeatedly call CCCryptorUpdate to encrypt the data

CCCryptorRelease(cryptor);

从问题和链接来看,您正在寻找AES的示例实现。我不会推荐这个 - 使用苹果的实现!

It seems from the question and the link that you are looking for example implementations of AES. I would not recommend this- use Apple's implementation!

它看起来像 http://pastie.org/297563.txt 也可能会帮助您,但我还没有测试。

It looks like http://pastie.org/297563.txt might help you also, but I haven't tested it.

这篇关于任何可可源代码为AES加密解密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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