PDA

View Full Version : bytes compressed and encrypted



RAYMON
- 2nd March 2009, 10:14
Hello

I need to store 40 channels of digital characters in a 512k eeprom and we need to compress the chain of maximum 40 bytes
I saw an example or the result after compression is 18 bytes
The string is converted to decimal hexadecimal

Example: 1234567890 = 10 bytes
Becomes: 12 34 56 78 90 = 5 bytes

I do not know if there is another way to further reduce the minimum bytes?
And once the data I have to compress encrypt in the same
eeprom you have an idea?
Even with encrypted xor chain is still a length of 18 bytes
Because I have an encrypted text and no way to decrypt it, I do not see
how it was I wanted to emulate him.
But apparently it must have a high level of programming and
Encryption is very strong.

Is there another way to encrypt without taking up too much space?

Jumper
- 2nd March 2009, 12:30
Hi,

If the size of the stored data is important this might be one way.

I ASSUME that you will only store numbers, and these numbers are from 0-9.

Imagine a number serie like this one where each number is one byte (8 bits):

1 1 1 2 3 4 ..... 9 9

Step one:

Group bytes 2 and 2 so you get this number serie stored as bytes, this I think you have already figured out:

when you do this you have to make sure you calculate in DECIMAL
3 4 -> 3 * 10 + 4 = 34 dec

11 12 34 ..... 99

Step 2:

Since the biggest number you will have to store this way is 99 it is enough to use 7 bits. So now we store 7 lower bits from the first byte + one bit from the next byte =8 and write to the eeprom.

This way will allow you to store 18 numbers using 8 Bytes. 44,4% size of the original data


This will also encrypt your data a little bit, if you want it to be more encrypted you just re-arrange the bit order in the BYTE you write to the ee-prom. If you have a good plan how to re-arrange the bits that covers 8 bytes it will be close to impossible to find out what you have stored. Bits inside this 8-byte block change places with each other.. or any other way of maipulating the bits with factor X .

To get the data back you just need to undo what you have done and put the bits back... extract the 7 + 1 bit into bytes... and split the Byte into 2.

So that would mean that you will work in block of 8 bytes compressing, encrypting and so on.

/me

RAYMON
- 3rd March 2009, 10:04
Hello

Thank you for your help, we assume that the string stored voullons

9976710618889188 = 07002013512770340000 and the date: 27/02/2009 19:20:51

A maximum compression to save space in the eeprom.
I attached an example and I can not understand

thank you

Jumper
- 3rd March 2009, 10:54
I am sorry but I have no intention to decrypt or analyze numbers to find out how they have been encrypted.

You asked for a way to store data, I gave you a suggestion.

Properly done and using a long enough key i.e 128 bit there is a very big risk you will get old without ever finding what you are looking for.

RAYMON
- 3rd March 2009, 11:24
Hello

This is an example I'm looking over, because the second part I did
not included.

Example this channel you compress how?

9976710618889188 = 07002013512770340000

Thank you