简体   繁体   English

为什么必须在AES算法中使用Base64库?

[英]Why must we use Base64 library in AES algorithms?

I'm writing a Java program to implements AES algorithms. 我正在编写一个Java程序来实现AES算法。 I reviewed in many Java sites or forums about their code. 我在许多Java网站或论坛中回顾了它们的代码。 1. http://zenu.wordpress.com/2011/09/21/aes-128bit-cross-platform-java-and-c-encryption-compatibility/ 2. http://www.code2learn.com/2011/06/encryption-and-decryption-of-data-using.html And I wonder why they always use Base64 library in their code. 1. http://zenu.wordpress.com/2011/09/21/aes-128bit-cross-platform-java-and-c-encryption-compatibility/ 2. 2. http://www.code2learn.com/2011/ 06 / encryption-and-decryption-of-data-using.html而且我想知道为什么他们总是在代码中使用Base64库。 I think it will make our program (encrypted and decrypted) slower than when we don't use it. 我认为这将使我们的程序(加密和解密)比不使用时慢。 Any one can be explain for me. 任何人都可以为我解释。

Base64 is easier to read, check and transfer. Base64更易于阅读,检查和传输。 eg email message with binary need Base64. 例如,带有二进制文件的电子邮件需要Base64。

While Base64 is slower, it is trivial compared with encryption and decryption. 虽然Base64速度较慢,但​​与加密和解密相比却是微不足道的。

You don't have to use Base64, but I suggest you use it to start with and remove it when everything is working. 您不必使用Base64,但是我建议您使用它作为开始,并在一切正常时将其删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM