Solved

encryption algorithm

Posted on 2003-12-11
8
464 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand recursion 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.

813 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

14 Experts available now in Live!

Get 1:1 Help Now