View previous topic :: View next topic |
Author |
Message |
kmp84
Joined: 02 Feb 2010 Posts: 354
|
DES |
Posted: Mon Dec 22, 2014 5:20 am |
|
|
Hi all
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: 9241 Location: Greensville,Ontario
|
|
Posted: Mon Dec 22, 2014 7:58 am |
|
|
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
|
Re: DES |
Posted: Mon Dec 22, 2014 9:04 am |
|
|
kmp84 wrote: | Hi all
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
|
|
Posted: Tue Dec 23, 2014 3:20 am |
|
|
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: 354
|
Re: DES |
Posted: Tue Dec 23, 2014 3:39 am |
|
|
ELCouz wrote: | kmp84 wrote: | Hi all
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! |
|
|
kmp84
Joined: 02 Feb 2010 Posts: 354
|
|
Posted: Tue Dec 23, 2014 3:50 am |
|
|
I think to use 16F1459..? |
|
|
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
|
|
kmp84
Joined: 02 Feb 2010 Posts: 354
|
|
Posted: Tue Dec 23, 2014 7:07 am |
|
|
ELCouz wrote: | Your application looks like a USB Dongle for software protection.... |
yes. |
|
|
ELCouz
Joined: 18 Jul 2007 Posts: 427 Location: Montreal,Quebec
|
|
Posted: Tue Dec 23, 2014 7:12 am |
|
|
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! |
|
|
|