How to encrypt a file in java using AES [duplicate]

好久不见. 提交于 2020-01-10 10:37:07

问题


I need to know how to create an AES and using it to encrypt and decrypt a file in java.


回答1:


Try using a CipherOutputStream and passing in a FileOutputStream. See http://www.java2s.com/Tutorial/Java/0490__Security/UsingCipherOutputStream.htm for a quick example, just use Cipher.getInstance("AES/CBC/PKCS5Padding") instead.



来源:https://stackoverflow.com/questions/5307499/how-to-encrypt-a-file-in-java-using-aes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!