Solved

# encryption algorithm

Posted on 2003-12-11
467 Views
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
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

LVL 45

Expert Comment

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

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

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

LVL 45

Accepted Solution

Kent Olsen 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

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

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

Question has a verified solution.

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

### Suggested Solutions

Inorder binary search tree 5 186
List out all word 7 359
c++ getting the first 10 characters of a char* string 11 111
Super Scope, DHCP 5 101
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â€¦
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 how to use strings and some functions related to them 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.
###### Suggested Courses
Course of the Month3 days, 9 hours left to enroll