Solved

encryption algorithm

Posted on 2003-12-11
8
459 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
8 Comments
 
LVL 45

Expert Comment

by:Kdo
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 45

Expert Comment

by:Kdo
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 45

Accepted Solution

by:
Kdo earned 168 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 166 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 166 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
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 how to create, access, and change arrays in the C programming language.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now