1. PGP 암호화 중 아래 에러
org.bouncycastle.openpgp.PGPException: exception encrypting session key
java.security.InvalidKeyException: Illegal key size or default parameters
=> key가 JDK/JRE 에 지정된 key size보다 커서 그래.
After google the web, I finally know this is actually caused by JDK/JRE security policy because
JDK/JRE has restricted key size. I choose ELGAMAL with key size 2048, thus, the exception is thrown. I have to download and install the Unlimited Strength Jurisdiction Policy Files from SUN. For example, I have to download jce_policy-6.zip for JDK 6 and unzip to my JAVA_HOME/jre/lib/security directory. After that, everything starts working.
jce_policy-6.zip 안에 jar파일 두개면 돼.. 끝.
2. 긁어온 소스(http://sloanseaman.com/wordpress/2011/08/11/pgp-encryptiondecryption-in-java/)로 디코딩할때
아래 에러 발생
org.bouncycastle.openpgp.PGPException: encrypted message contains a signed message – not literal data..
=> signed 된거라서 그래.(참고:http://david.tribble.com/text/pgpsign.htm)
sign하고 암호화한거야. 그리고 우리도 사인하고 암호화처리 해줘야했어.
더 긁어온 소스로 수정
http://www.docjar.org/html/api/org/bouncycastle/openpgp/examples/SignedFileProcessor.java.html
수정
긁어온거의 나중버전
http://sloanseaman.com/wordpress/2012/05/13/revisited-pgp-encryptiondecryption-in-java/
PGP
http://www.terms.co.kr/PGP.htm
http://en.wikipedia.org/wiki/Pretty_Good_Privacy
한글 개념
http://www.linuxlab.co.kr/docs/2-4.htm#13
'etc..' 카테고리의 다른 글
음악의 신 (0) | 2012.06.05 |
---|---|
SyntaxHighlighter 사용 (0) | 2012.05.01 |