Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Crypto - Which algorithm is used?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-10-2007, 05:58 AM
Junior Member
 
Join Date: Nov 2007
Posts: 23
Default Crypto - Which algorithm is used?

Hi All, just wondering if anyone knows which encryption algorithm is used in the Crypto library?

I need to know:

The cipher, the number of bits used (64/128/256?), the padding method used (EBC, CBC, etc).

I'm encrypting data to send to php on a web server, and I can't decrypt the data unless i know these things.

Thank for your help!
Andy.
Reply With Quote
  #2 (permalink)  
Old 11-10-2007, 10:07 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,690
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

According to the help file for Crypto it is only 40 bits, I suspect RC2, which is not terribly secure - though that may not matter for your app. This may have been chosen because it is quite a fast algortithm - about twice as fast as single DES I believe - and as B4PPC is really targeted at devices this is of value.

If you are prepared to write your own library, which earlier posts imply you are, AND you are prepared to use Compact Framework 2.0 on the device or restrict yourself to the desktop then I would knock up a library to access the .NET System.Security.Cryptography services as this will give you choice of several symmetric and non-symmetric algorithms of much much greater security. I would use TripleDES for symmetric and RSA for public key asymmetric.

Out of interest - did you resolve the resolution issue and if so what was the problem?
Reply With Quote
  #3 (permalink)  
Old 11-10-2007, 01:23 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

The Crypto library is based on this article and code example: http://www.codeproject.com/netcf/SecureStore.asp
I think you can find your answers there.
Reply With Quote
  #4 (permalink)  
Old 11-11-2007, 12:01 AM
Junior Member
 
Join Date: Nov 2007
Posts: 23
Default

Thanks guys, that will be of help.

I have decided to use V2 of the compact framework, as the SQLite library is just too nice. PHP supports SQLite V3 natively, which means i can invoke a web url, get php to build a SQLite database, and then download it to the device... very easy syncronisation.

I need encryption because I want to encrypt the authentication / login details for each user when they request a database to be built. I may also encrypt the database itself before transit.

I may write my own library as you've suggested, and if I do I'll release it for everyone else. The only problem is that I am using SharpDevelop, which builds "desktop" dll's fine, but not compact. Perhaps I can release the code and have someone else build the compact edition version :-)

As for the screen resolution issue, no I still haven't figured that out. For now I'm writing with the default screen size and testing just on the windows version. I can also use the emulator. The AXIM is actually honoring the screen size settings of the IDE.. strange hey.

Anyway, thanks for your help as always. I was really impressed with just how easy it was to invoke a URL and download a file with the HTTP library - the functions were already written! Gotta love cut n paste :-)

Andy.
Reply With Quote
  #5 (permalink)  
Old 11-11-2007, 12:12 AM
Junior Member
 
Join Date: Nov 2007
Posts: 23
Default

Hi Erel, thanks for the link. Just to confirm:

* You're using RC2, 128 bit.
* The secret key passed to the crypto library is hashed with the md5 algorithm, and you're then using the first 40 characters of the hash to use as the encryption key.

Is that right?

Also, is there a base64 encode / decode class library? I will need to encode the encryption result before passing it in my URL. My url will be something like:

http://www.mysite.com/rmi.php?userna...ase64encrypted

Cheers,
Andy.
Reply With Quote
  #6 (permalink)  
Old 11-11-2007, 05:01 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

Yes, this is right.
There is no base64 encode/decode library.
I guess that it shouldn't be hard to create one.
Reply With Quote
  #7 (permalink)  
Old 11-11-2007, 09:17 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,690
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Nycran View Post
The only problem is that I am using SharpDevelop, which builds "desktop" dll's fine, but not compact.
I use VS2005 but I am fairly sure sure that other people here (Dzt and Cableguy) are using SharpDevelop to build Compact Framework libraries. See post #11 onwards in this thread.

How to create a Basic4ppc library
Reply With Quote
  #8 (permalink)  
Old 11-11-2007, 10:13 AM
taximania's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 231
Awards Showcase
Beta Tester 
Total Awards: 1
Default

It must be a device thing.
Doesn't matter what settings I alter in SharpDevelop. .NET, 1.1, 2.0, Net Framework etc, the compiled DLL's work on the Desktop but not my device.

Strange, works for CableGuy
__________________
Endemol
Waste of space

O2 XDA Artemis Touch Flo 4.02 Full Cube Rom WM6.1

http://www.taximania.net
Reply With Quote
  #9 (permalink)  
Old 11-11-2007, 10:25 AM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi,

Actually I use both tools (VS2005 & #develop).

VS is a better tool in general, but #develop has 2 advantages for this forum. Using it you can easily switch between various frameworks (including Mono Project) and posting the source code, someone can without the need to pay enything to use it.

Of course you can compile for .NETCF but .NETCF 1.0 SDK does not exists out of VS (2003 & 2005)
__________________
Dimitris Zacharakis
http://www.terracom.gr
Reply With Quote
  #10 (permalink)  
Old 11-11-2007, 10:52 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,690
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by dzt View Post
Of course you can compile for .NETCF but .NETCF 1.0 SDK does not exists out of VS (2003 & 2005)
Hi dzt, can you expand on this comment please. I know that I don't know all the ins and outs of what VS can and cannot do.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help understanding Crypto tsteward Questions & Help Needed 1 09-15-2008 02:23 PM
Crypto error Raytracer Questions & Help Needed 4 07-31-2008 12:39 PM
Crypto Error Raytracer Italian Forum 0 07-30-2008 04:39 PM
Easter Day (calculation algorithm) maXim Code Samples & Tips 2 03-19-2008 05:01 PM
Crypto library was updated - 1.10 Erel Announcements 2 10-19-2007 08:44 AM


All times are GMT. The time now is 04:38 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0