iPHone - AES 256加密,无填充 [英] iPHone - AES 256 encryption without padding

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

问题描述

我在iphone上看到了一些关于AES 256加密的帖子。
其中一个帖子是 http://pastie.org/426530
但是所有帖子都是帖子正在使用某种填充。如何在不使用任何填充的情况下使用AES256加密?

I've seen some of the posts for AES 256 encryption on iphone usign cocoa. One of the post is http://pastie.org/426530 But all the posts are using some kind of padding. How can I use AES256 encryption without using any padding?

因为我正在与没有填充处理加密/解密的服务器进行通信。但是在iphone上,我只能使用kCCOptionPKCS7Padding或kCCOptionECBMode模式。如何编写我的iphone应用程序,以便加密/解密成功发生?

Because, I'm communicating with a server on which encryption/decryption is handled without padding. But on iphone, I can use kCCOptionPKCS7Padding or kCCOptionECBMode modes only. How can I code my iphone app so that encryption/decryption happens successfully?

推荐答案

分组密码将始终是其块的倍数尺寸。当数据不完全适合密码流时,它会被填充。因此,不需要禁用填充。

Block ciphers will always be a multiple of their block size. When data does not fit exactly into the cipher stream it is padded. So, there's no need to disable padding.

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

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