CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

asymmetric cryptography

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pattousai



Joined: 23 Aug 2006
Posts: 37

View user's profile Send private message

asymmetric cryptography
PostPosted: Fri Jul 09, 2010 1:10 pm     Reply with quote

Hi everybody,

I know this is a regular question (if there is any library that implement), but this time I'm asking if it is possible to do asymmetric cryptography in a PIC family device (dsPIC, PIC24 etc).

The Microchip has one library that implement many asymmetric cryptography functions (so, I believe it is possible to do in a CCS compiler, actually, the question is about hardware), but this library don't generate the keys, only implement the encryption and decryption functions (which is a lot, ok). So... my question is: with a PIC family hardware, is possible to implement the function that generate the asymmetric keys?

I know that would be more 'correct' that I just study the asymmetric cryptography theory and study the better PIC hardware and then conclude my question by myself (actually, I pretend to do so), but even then, I can't be sure of my conclusion, so... I thought that I could ask this here...

Thanks for the attention and sorry for the english,
Victor Hugo.
Ttelmah



Joined: 11 Mar 2010
Posts: 19540

View user's profile Send private message

PostPosted: Sat Jul 10, 2010 3:09 pm     Reply with quote

Possible. Yes.
Sensible. Arguable.....

Even on the smaller PIC's, it is perfectly possible to generate your own maths library using BCD, to handle large numbers, and with this calculate prime numbers. Given a lot of time, this could then calculate you a sequence of large primes. Then chosing values from this at 'random' (this is one of the hard parts....), calculate the product of these (call this n), the Euler totient of this, and a number that is less than this, and has no common factors with it (call this 'e'). Again you need a good 'random' algorithm to make the selection of this unlikely to be predictable. With these calculated, you need to destroy all record of how the numbers were derived (delete seed values generated to create the random steps etc., and the prime numbers used). You then calculate the unique value 'd', satifying the relation (d-e)%totient = 1.
Then 'n' is the public key, and 'd' is the private key.
It'll take a lot of time, and the quality of the random values is critical in how good the keys are. Count thermal noise from a photo-cell, for example, as a good way of seeding a standard psuedo random sequence generator.
It'll take significant time, and space, but could potentially be programmed on just about any chip. It will though require a probably custom maths library, and will require a really good random number source, if it is not to be easy to crack....

Best Wishes
pattousai



Joined: 23 Aug 2006
Posts: 37

View user's profile Send private message

PostPosted: Sun Jul 11, 2010 3:38 pm     Reply with quote

Thanks Ttelmah, for the very good answer...

Well, to be honest I always thought that was very possible to make asymmetric cryptography (including generate the keys) in the PIC's hardware, but I am very surprised that nobody ever implemented this (at least I do not find).

But I will study this with more motivation now.

Thanks again
John P



Joined: 17 Sep 2003
Posts: 331

View user's profile Send private message

PostPosted: Sun Jul 11, 2010 5:00 pm     Reply with quote

Didn't Turing demonstrate that any processor can run any computational task? All you need is enough memory space and enough time!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group