BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-01-2008, 04:09 AM   #1
liza
New Member
 
Join Date: Jan 2008
Model: 8800
PIN: N/A
Carrier: asdf
Posts: 8
Default Encryption

Please Login to Remove!

I have a login page. In this page i pass the user credentials to the webservice. I want to encrypt the credentials and send it to the webservice. How do i do the encryption?
Offline  
Old 07-01-2008, 04:23 AM   #2
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Default

encrypt it on transport layer using https (SSL/TLS)
Offline  
Old 07-01-2008, 04:36 AM   #3
liza
New Member
 
Join Date: Jan 2008
Model: 8800
PIN: N/A
Carrier: asdf
Posts: 8
Default

how do i do the encryption...can u send me some sample code....
i just hav 2 encrypt d username and password...
Offline  
Old 07-01-2008, 03:12 PM   #4
holy3daps
Thumbs Must Hurt
 
Join Date: Apr 2006
Location: Boston
Model: 8900
Carrier: AT&T
Posts: 98
Default

Hi!

So, like many of the questions, the answer to "how do I do the encryption" is: It Depends.

What is the "webservice" expecting? It should have a protocol designed to accept username and password, and it should explain how you put the username and password into the stream of information you are required to deliver.

What kind of encryption are you planning to do to the username and password? This leads back to the previous question. If the webservice doesn't have the key needed to decrypt the username and password, any encryption scheme is going to fail.

If the webservice is expecting your application to transmit over SSL/TLS, the encryption is handled by the OS on both sides. I would expect that this information is being transmitted via SSL/TLS anyway, because you don't want to send un/pw info over regular HTTP.

Usually username and password information is hashed - a unique number is generated based on what the cleartext un/pw are, and this number is compared to a hash of the available un/pw in the service (usually just the password is hashed at both ends, because usernames tend to be readily available anyway). If the comparison succeeds (i.e., the webservice hash of user AAA's password matches the hash value generated on the BlackBerry for the password provided by user AAA), then good things happen.

The BlackBerry API comes with a great deal of crypto classes, which you'll need to sign your app to be able to use. Check out net.rim.device.api.crypto, it will list the packages and classes it contains. Look for "SHA1Digest" as well as "MD5Digest" - these are "Digest" classes, which is another fancy name for "Hash". Sort of.

Cheers,

karl
__________________
Karl G. Kowalski
---------------
Owns a RAZR
Develops for BlackBerry
So next phone will be........an iPhone 3G!
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


USA Windows VPS RDP Server/ Windows VPS Hosting - 4GB RAM + 150GB HDD picture

USA Windows VPS RDP Server/ Windows VPS Hosting - 4GB RAM + 150GB HDD

$11.99



LRS T9560-EZ Server Paging System - Powers On - Read picture

LRS T9560-EZ Server Paging System - Powers On - Read

$80.99



LRS T9560-EZ Server Paging System - Powers On - Read picture

LRS T9560-EZ Server Paging System - Powers On - Read

$80.99



USA Windows VPS RDP Server/ Windows VPS Hosting - 4GB RAM + 150GB HDD -  1 Year picture

USA Windows VPS RDP Server/ Windows VPS Hosting - 4GB RAM + 150GB HDD - 1 Year

$129.88



EMC2 HPE-S HPES Server picture

EMC2 HPE-S HPES Server

$465.00



Nortel Meridian NTRH14AA RLSE 16 Server w/2 MPC-8 Cards Hard Drive picture

Nortel Meridian NTRH14AA RLSE 16 Server w/2 MPC-8 Cards Hard Drive

$84.95







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