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 support@ccsinfo.com

DES

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



Joined: 02 Feb 2010
Posts: 345

View user's profile Send private message

DES
PostPosted: Mon Dec 22, 2014 5:20 am     Reply with quote

Hi all Smile
Had someone experience with DES and 3DES Encryption Standard, example?
I want to make some USB device(PIC with USB) talking to PC application!
I have USB stack working.
Thanks,
temtronic



Joined: 01 Jul 2010
Posts: 9165
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Dec 22, 2014 7:58 am     Reply with quote

Microchip have several application notes about it, you'd need to 'port' their C code into CCS C, not that hard really.....


might try 'Google'. there are lots of 'hit' about it....


jay
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

Re: DES
PostPosted: Mon Dec 22, 2014 9:04 am     Reply with quote

kmp84 wrote:
Hi all Smile
Had someone experience with DES and 3DES Encryption Standard, example?
I want to make some USB device(PIC with USB) talking to PC application!
I have USB stack working.
Thanks,


DES isn't secure anymore... (since 1998)

Could be cracked easily with a recent GPU...

6840 Millions DES keys per seconds is possible with a Radeon 7970 HD GPU.
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Dec 23, 2014 3:20 am     Reply with quote

Now that others have said you shouldn't use DES, it is worth to point to an algorithm to use instead: AES
The bad news is that I don't think there is a ready to use library for the CCS compiler so you will have to convert from another compiler.

You didn't mention which processor (family) you are going to use. For PIC16/PIC18 it is possible but you'll need something like 3k ROM and 512 bytes RAM just for the encryption routines alone, so try to use one of the higher capacity models. PIC24 and dsPIC will be much easier as these have more resources.

Application Note AN953 describes several encryption algorithms for PIC18, including AES.
Application Note AN821 is an AES implementation in assembly for the PIC16.

Software can be found here: http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=SW300052

All above software will have to be adapted for use with the CCS compiler.

Another interesting forum topic discussing AES implementations on the PIC processor: http://electronics.stackexchange.com/questions/13275/smallest-aes-implementation-for-microcontrollers
kmp84



Joined: 02 Feb 2010
Posts: 345

View user's profile Send private message

Re: DES
PostPosted: Tue Dec 23, 2014 3:39 am     Reply with quote

ELCouz wrote:
kmp84 wrote:
Hi all Smile
Had someone experience with DES and 3DES Encryption Standard, example?
I want to make some USB device(PIC with USB) talking to PC application!
I have USB stack working.
Thanks,


DES isn't secure anymore... (since 1998)

Could be cracked easily with a recent GPU...

6840 Millions DES keys per seconds is possible with a Radeon 7970 HD GPU.


Okay, But when pc application see 1 wrong data packet and reject USB device with timeout about 10 min. "HD7970" will wait for next iteration after 10 min. What is suitable еncryption algorithm to adapt to PIC16 over USB ?

Thank you for conversation!Smile
kmp84



Joined: 02 Feb 2010
Posts: 345

View user's profile Send private message

PostPosted: Tue Dec 23, 2014 3:50 am     Reply with quote

ckielstra wrote:
Now that others have said you shouldn't use DES, it is worth to point to an algorithm to use instead: AES
The bad news is that I don't think there is a ready to use library for the CCS compiler so you will have to convert from another compiler.

You didn't mention which processor (family) you are going to use. For PIC16/PIC18 it is possible but you'll need something like 3k ROM and 512 bytes RAM just for the encryption routines alone, so try to use one of the higher capacity models. PIC24 and dsPIC will be much easier as these have more resources.

Application Note AN953 describes several encryption algorithms for PIC18, including AES.
Application Note AN821 is an AES implementation in assembly for the PIC16.

Software can be found here: http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=SW300052

All above software will have to be adapted for use with the CCS compiler.

Another interesting forum topic discussing AES implementations on the PIC processor: http://electronics.stackexchange.com/questions/13275/smallest-aes-implementation-for-microcontrollers

I think to use 16F1459..?
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Tue Dec 23, 2014 7:03 am     Reply with quote

Your application looks like a USB Dongle for software protection....
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
kmp84



Joined: 02 Feb 2010
Posts: 345

View user's profile Send private message

PostPosted: Tue Dec 23, 2014 7:07 am     Reply with quote

ELCouz wrote:
Your application looks like a USB Dongle for software protection....

yes.Smile
ELCouz



Joined: 18 Jul 2007
Posts: 427
Location: Montreal,Quebec

View user's profile Send private message

PostPosted: Tue Dec 23, 2014 7:12 am     Reply with quote

It's better to use your dongle actively to make some calculation part of your application or store encrypted data crucial for the application to run than some AES or DES key check.


This can easily defeated (patched) by a single jump instruction in your application executable with a disassembler.
_________________
Regards,
Laurent

-----------
Here's my first visual theme for the CCS C Compiler. Enjoy!
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