Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

encryption algorithm

Posted on 2003-12-11
8
Medium Priority
?
469 Views
Last Modified: 2010-04-15
I am looking for a low memory encryption algorithm to put on a 16 bit motorola processor. I am going to be downloading code to the processor and I want the bootloader to de-encrypt the code before saving it to the rom. I need an algorithm that will not take that much space. (assuming pgp is way too big). I appreciate any suggestions.

-Mike
0
Comment
Question by:mjhnational
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 9920453

How secure do you need the object to be?  Is "nuisance" encryption (where the program obviously can't be executed "as is" and the code can be cracked in a few hours) sufficient?

Kent
0
 

Author Comment

by:mjhnational
ID: 9920530
We are actually trying to protect the code being downloaded. So it is very important that the encryption is difficult to break.

Thanks
-Mike
0
 
LVL 46

Expert Comment

by:Kent Olsen
ID: 9920555
Hi mjhnational,

Here's a small encryption/decryption algorithm that will mangle a buffer on the first pass, unmangle it on the second.  It's not super secure and can be broken fairly easily, but it's very small and fast and will certainly cut down on the encrypted program being run "accidentally".  :)


#define MAXKEYS 21

static unsigned char Keylist[MAXKEYS] = {0xC2, 0x5D, 0x11, 0x1A, 0xE0, ....};

DecodeBuffer (char *Buffer, int Length)
{
  int idx;

  for (idx = 0; idx < Length; ++idx)
    Buffer[idx] ^= Keylist[idx % MAXKEYS];
}



Good Luck,
Kent
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 46

Accepted Solution

by:
Kent Olsen earned 672 total points
ID: 9920569
Hi mjhnational,

Have you looked into TEA (Tiny Encryption Algorithm)?  There are quite a few web sites about it.  Google search on "TEA encryption" and you'll get a lot more quality links than I can post.


Kent
0
 
LVL 19

Assisted Solution

by:Dexstar
Dexstar earned 664 total points
ID: 9924682
@mjhnational:

>  I appreciate any suggestions.

I suggest RC4.  It is cryptographically secure, but it is symmetric, so you'll have to store the key safely.  It is much more light weight than the algorithm used by PGP.

Here is the complete source:
http://www.cr0.net:8040/code/crypto/rc4/

Hope That Helps,
Dex*
0
 
LVL 45

Assisted Solution

by:sunnycoder
sunnycoder earned 664 total points
ID: 9933171
>I am looking for a low memory encryption algorithm to put on a 16 bit motorola processor
>We are actually trying to protect the code being downloaded. So it is very important that the encryption is difficult to break.
I guess that since you are working with an embedded system and 16 bit processor, you have limited processing capability.
However what matters more is the acceptable time limit for decryption ... It is well know fact that longer the key, longer it takes to break it... but are you willing to go in for 256 (or even 128) bit encryption on your platform?

Any of the well known algorithms (RSA, triple DSA) should do the trick for you... they are hard to break

If you cannot afford that much processing delay, you can go in for some lighter algorithm such as TEA but the tradeoff remains.

May be you can look at something like... negotiating symmetric key with the downloading node (after authentication and checking licensing) using asymmetric key cryptography... this negotiation will give you a symmetric key ... you can encrypt your code with the symmetric key at the server (on the fly) and send it to receiver who will then download and decrypt it...

Since you will be using symmetric key only once, it should be safe enough .. also, I feel that you can program the downloading part yourself on your platform ... so you can take usula precautions for security at that end too
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question