文件与文本加密Rijndael算法 [英] File vs Text encryption Rijndael Algorithm

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

问题描述

使用rijndael算法加密文件和加密文本的代码有什么区别?

What is the difference in the code to encrypt a file and a code to encrypt text using rijndael algorithm ?

推荐答案

为了加密你应该提供的文件还有文件 I / O 操作。那就是你必须:

In order to encrypt a file you should provide also the file I/O operations. That is you have to:
  1. 将输入文件读入内存缓冲区。
  2. 加密内存缓冲区。
  3. 编写加密的内存缓冲区到输出文件。
  4. 仅需要步骤(1)(3)加密文件。
  1. Read the input file into a memory buffer.
  2. Encrypt the memory buffer.
  3. Write the encrypted memory buffer to the output file.
  4. Steps (1) and (3) are only required for encrypting a file.


可能没什么。但是您可以使用文本文件轻松测试它,并通过传递相同的文本对其进行加密,并将结果与​​加密文件的结果进行比较。如果它完全相同,那么你知道。



祝你好运!
Probably nothing. But you can easy test it using a text file and encrypt it by passing it the same text and compare the results to that of of encrypting the file. If it is exactly the same, well, then you know.

Good luck!


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

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