BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 11-18-2004, 04:41 PM   #1
WorldIRC
CrackBerry Addict
 
WorldIRC's Avatar
 
Join Date: Oct 2004
Location: Toronto
Model: 9900
OS: 5.0.0.0
Carrier: Rogers Wireless
Posts: 916
Default

Please Login to Remove!

__________________
Brian Bader
MSN / Email: [email address]
AOL: WorldIRC1986
Offline  
Old 11-18-2004, 09:43 PM   #2
Mark Rejhon
Retired BBF Moderator
 
Mark Rejhon's Avatar
 
Join Date: Aug 2004
Location: Ottawa, Ontario, Canada
Model: Bold
Carrier: Rogers
Posts: 4,870
Default

__________________
Thanks,
Mark Rejhon
Author of XMPP extension XEP-0301:
www.xmpp.org/extensions/xep-0301.html - specification
www.realjabber.org - open source
Offline  
Old 11-18-2004, 10:03 PM   #3
WorldIRC
CrackBerry Addict
 
WorldIRC's Avatar
 
Join Date: Oct 2004
Location: Toronto
Model: 9900
OS: 5.0.0.0
Carrier: Rogers Wireless
Posts: 916
Default

__________________
Brian Bader
MSN / Email: [email address]
AOL: WorldIRC1986
Offline  
Old 01-14-2005, 04:23 AM   #4
Dev2100
New Member
 
Join Date: Sep 2004
Posts: 11
Default AES Encryption Issue

This is Code on Client (RIM JDE)
Code:
AESKey key = new AESKeyxxx40;128xxx41;;
 
EncodedKey encodedKey = SymmetricKeyEncoder.encodexxx40;key, "PKCS8" xxx41;;
System.out.printlnxxx40;"Encoded Key Format" + encodedKey.getEncodingAlgorithmxxx40;xxx41;xxx41;;
System.out.printlnxxx40;"AES Key Algoritham" + key.getAlgorithmxxx40;xxx41;xxx41;;
System.out.printlnxxx40;"Encoded Key Length" + key.getLengthxxx40;xxx41;xxx41;;
System.out.printlnxxx40;"Encoded Key BitLength" + key.getBitLengthxxx40;xxx41;xxx41;;
                 
ifxxx40;!sendMessagexxx40;encodedKey.getEncodedKeyxxx40;xxx41;xxx41;xxx41;xxx123;
       System.out.printlnxxx40;"Failed to send AES Key"xxx41;;
xxx125;
I m encoding the key and transmiting this key to server using UDP.
on server side(UDP server implemented in Java with Certicom API)
decoding the Key in PKCS#8 format to get AES Key


Here is the Code on Server
Code:
PKCS8EncodedKeySpec k1spec = new PKCS8EncodedKeySpecxxx40;receiveKeyxxx40;xxx41;xxx41;;
System.out.printlnxxx40;"Encoding Format" + k1spec.getFormatxxx40;xxx41;xxx41;;
SecretKeyFactory skf = SecretKeyFactory.getInstancexxx40;"AES","Certicom"xxx41;;
SecretKey ssk = skf.generateSecretxxx40;k1specxxx41;;
Cipher eAESCipher = Cipher.getInstancexxx40;"AES"xxx41;;
eAESCipher.initxxx40;Cipher.DECRYPT_MODE,sskxxx41;;
BUt server throw exception
Exception :java.security.spec.InvalidKeySpecException: Invalid key spec

As on client as well as server I chked the encoding Format and it says PKCS#8
then why I am geting this exception.

[Edited by Mark Rejhon to add [code] and [/code] tags to put source code in formatted blocks]
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$317.00



Dentistry Replacement NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L NEW picture

Dentistry Replacement NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L NEW

$79.95



A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board picture

A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board

$350.00



NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L CERAMIC BEARINGS  picture

NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L CERAMIC BEARINGS

$80.75



Radiomatic Flo-One Beta Radio-Chromatography Detector A-500 Model A525 [E2FL] picture

Radiomatic Flo-One Beta Radio-Chromatography Detector A-500 Model A525 [E2FL]

$245.00



Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP  picture

Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP

$649.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.