From: noreen <nor...@gm...> - 2008-11-24 08:16:48
|
Do RSA legacy keys always use key type RSA and the IDEA cipher? How do you create an RSA key with cipher=IDEA? I have included the code so far with the error that was generated: //create an RSA key KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance( "RSA" ); this.cipher = Cipher.getInstance("RSA"); keyPairGen.initialize( 1024 ); // use the key to initialize the idea cipher this.cipher = Cipher.getInstance("IDEA", "CryptixCrypto"); cipher.init( Cipher.ENCRYPT_MODE, keyParirGen.getKeyPair.getPublic() ); CODE OUTPUT cipher algorithm IDEA BlockSize=8 KeyPair Algorithm RSA Key AlgorithmRSA format= X.509 serialVersionID=-8727434096241101194 Invalid user key length java.security.InvalidKeyException: Invalid user key length at cryptix.jce.provider.cipher.IDEA.makeKey(IDEA.java:156) at cryptix.jce.provider.cipher.IDEA.coreInit(IDEA.java:78) at cryptix.jce.provider.cipher.ModeECB.coreInit(ModeECB.java:53) at cryptix.jce.provider.cipher.Mode.init(Mode.java:115) at cryptix.jce.provider.cipher.Padding.init(Padding.java:154) at cryptix.jce.provider.cipher.BlockCipher.engineInit(BlockCipher.java:286) at cryptix.jce.provider.cipher.BlockCipher.engineInit(BlockCipher.java:271) at javax.crypto.Cipher.init(DashoA13*..) at javax.crypto.Cipher.init(DashoA13*..) at Crypt.<init>(Crypt.java:44) at Crypt.main(Crypt.java:84) |