관리 메뉴

나만의공간

AES256 암호화시 java.security.InvalidKeyException: Illegal key size 해결 방안 본문

보안/암호화

AES256 암호화시 java.security.InvalidKeyException: Illegal key size 해결 방안

밥알이 2015. 12. 8. 17:55

JAVA의 기본 정책으로는 AES128 암호화 방식까지만 사용이 가능하므로
AES256 방식으로 암호화를 하게 되면 아래와 같은 Exceptioin이 발생합니다.

java.security.InvalidKeyException: Illegal key size

이를 해결하기 위한 방법은

$JAVA_HOME/jre/lib/security 에 아래의 unlimited strength crypto file을 덮어 쓰기 하시면 됩니다.

local_policy.jar US_export_policy.jar

Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 다운로드

참고로 미 통상법에 의해 자국내에서만 AES256 방식이 허용되었다고 하네요.

아래 내용 참고하시면 되겠습니다.
참고 URL : http://www.raritan.com/helpfiles/ccsg42/en/1926.htm

Check Your Browser for AES Encryption

CC-SG supports AES-128 and AES-256. If you do not know if your browser uses AES, check with the browser manufacturer.

You may also want to try navigating to the following web site using the browser whose encryption method you want to check: https://www.fortify.net/sslcheck.html. This web site will detect your browser’s encryption method and display a report. Raritan is not affiliated with this web site.

Note: Internet Explorer 6 does not support AES-128 or -256 encryption.

AES-256 Prerequisites and Supported Configurations

AES-256 encryption is supported on the following web browsers only:

  • Firefox 2.0.0.x and later
  • Internet Explorer 7

Note: Internet Explorer 7 supports AES-128 or -256 encryption in Windows Vista only. It does not support any AES encryption in Windows XP.

In addition to browser support, AES-256 encryption requires the installation of Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6.

To enable the AES-256 encryption with your browser

  1. Download JCE Unlimited Strength Jurisdiction Policy Files 6 from http://java.sun.com/javase/downloads/index.jsp.
  2. Extract the files into your Java directory under \lib\security\. For example, C:\Program Files\Java 1.6.0\lib\security\.

 

'보안 > 암호화' 카테고리의 다른 글

AES256 암호화 JAVA 알고리즘  (2) 2014.06.26
Comments