Java default does not support AES256

Source: Internet
Author: User

The default Java AES supports a maximum of 128bit keys, and throws an exception if you use a 256bit key:

Java.security.InvalidKeyException:Illegal Key Size


In fact, the Java Official network provides a solution, need to download "Java Cryptography Extension (JCE) Unlimited strength jurisdiction Policy Files for Jdk/jre 8", replace the JDK 2 jar packages in the/JRE.


:

Http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html


The entrance to the JCE is pulled down on the Javase page to find the "Additional Resources", which can be seen:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/88/8D/wKiom1f7VkeBNLOVAAByxCmUdGs471.png "title=" 1.png " alt= "Wkiom1f7vkebnlovaabyxcmudgs471.png"/>


Download will get a ZIP package, the inside of the Local_policy.jar and Us_export_policy.jar extracted to the JDK installation directory \jre\lib\security overwrite the original file, The independent JRE is also covered with the same path files.



This article is from the "Rabbit Nest" blog, please be sure to keep this source http://boytnt.blog.51cto.com/966121/1860309

Java default does not support AES256

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.