티스토리 뷰

 


java.security.InvalidKeyException: Illegal key size or default parameters
=> 키 제한때문에 생기는 오류일 수 있습니다.

JDK 1.4.x부터는 JCE가 기본적으로 포함이 되어 있으며 미국 수출 통상법에 따라 사용할 수 있는 키 길이 등에 제한이 걸려있습니다.

Within the libraries of the Java Cryptography Extension (JCE), you'll find support for encryption, decryption, key agreement, Message Authentication Code (MAC), and some other cryptographic services. Due to import control restrictions of some countries, the JCE jurisdiction policy files shipped with the Java 2 SDK, release 1.4 allow "strong" but limited cryptography to be used. An "unlimited strength" version of these files indicating no restrictions on cryptographic strengths is available for those living in eligible countries (most countries). You can download this version and replace the string cryptography versions supplied with the Java 2 SDK, release 1.4 with the unlimited ones.


해결방법
제한이 없는 정책파일로 변경하면 됩니다.



오라클 홈페이지에 다운로드로 가셔서 Java for Developers 로 이동합니다.


다운로드 탭을 선택 후 아래쪽으로 쭈~욱 이동하시면


위와 같이 제한없는 정책파일을 다운받으실 수 있습니다.
알맞은 정책파일을 다운 받습니다.

JDK나 JRE가 설치된 곳의 해당 위치에 있는 다음 파일을 덮어 쓰면 됩니다. 
=> C:\Program Files\Java\jdk1.6.0_29\jre\lib\security
=> C:\Program Files\Java\jre6\lib\security

정책파일 : local_policy.jar, US_export_policy.jar


제한 정책 파일에 의해 허가된 최대 키 사이즈
Algorithm Maximum Keysize
DES 64
DESede *
RC2 128
RC4 128
RC5 128
RSA *
all others 128


참고

Java ™ Cryptography Architecture (JCA) Reference Guide
http://docs.oracle.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html


Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6

Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7

Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8


반응형
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함