AES加密 - 大文件 [英] AES Encryption- large files

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

问题描述

我做的使用OpenSSL的EVP接口在128/192/256 CBC模式C语言AES加密。
我发现了一个计算器很好的例子与我已经开始编程。

我想知道的是:


  1. 什么是加密时?使用默认的填充

  2. 如果我有大量的数据会发生什么。我一定要code把它分成128位数据块?或做EVP接口照顾它?

  3. 应该是什么IV为128位,192bit的和256位CBC模式的大小(其中仅密钥长度分别为128,192,256和块大小始终是128)

感谢


解决方案

  1. 有是没有加密的默认填充。有几种填充方案。对于EVP有接受一个不完整的块,并添加填充(默认PKCS填充),并进行加密的加密最后一个方法。


  2. EVP将照顾它。


  3. 当使用CBC模式的第四向量的大小的大小与块大小相同。


I am doing AES encryption using EVP interface of OpenSSL in C language in the 128/192/256 cbc modes. I found a nice example in stackoverflow with which I have started programming.

What I would like to know is:

  1. What is the default padding used while encryption?
  2. What happens if I have large data. Do I have to code to divide it into data blocks of 128 bits? or does EVP interface takes care of it?
  3. What should be the size of the IV for 128bit, 192bit and 256bit cbc modes(where only the key lengths are 128, 192, 256 respectively and the block size is always 128)

thanks

解决方案

  1. There is no default padding for encryption. There are several padding schemes. For EVP there is an encrypt final method that takes an incomplete block and adds padding (default PKCS padding) and encrypts it.

  2. EVP will take care of it.

  3. Size of the IV vector when CBC mode is used is the same size as the block size.

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

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