Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1]   Go Down
Author Topic: Encryption with arduino board  (Read 5079 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys.

Is it possible to create a sketch running on Arduino for data encryption?

Thanks, have a nice day
Logged

Cheltenham, England
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino Fiend
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure it's possible, but the ATMEGA168 (on the diecimila at least) is only 16Mhz, so encrypting anything with a "modern" algorithm (AES, RSA) will take at least a few seconds, depending entirely on key length, rounds used, string to encrypt/decrypt, etc.

Plus the diecimila only has 512bytes of memory, which must include storage space for the variables used to decode the encrypted string (or encode the plaintext string), so you're going to be limited to probably 256 bytes at most (two SMS messages worth of text).
Plus you need storage space for the key, an means to input and output the messages and possibly the keys.

I'd recommend a more powerful device for doing cryptography personally, but you could easily use an arduino for Classical cryptography - Vigenere ciphers and Shift/Substitution ciphers for example. These require very little computation as they are character-based - they were essentially around just before computers could decode them.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh Tim, thanks so much for answering!

Have a nice day!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, but arduino board operate at 16 bit or 32 bit?

Thanks
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The arduino uses an 8 bit CPU.

What is it you wanted the arduino to do?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I'd like to develop the Elliptic Curve algorithm.

detalis here: http://www.shamus.ie/

I believe that is not possibile...just 8 bit cpu.

What do you think?
« Last Edit: December 08, 2008, 04:18:30 am by ard10000 » Logged

Cheltenham, England
Offline Offline
Newbie
*
Karma: 0
Posts: 21
Arduino Fiend
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

ECC is one of the most complex AND computationally intensive encryption routines, due to the nature of Elliptic Curves. ECC is based upon solving the discreet logarithm problem and that in itself requires a very high level of knowledge of mathematics.

I'd recommend strongly that you try something simpler first, or implement what you're trying to do in 16 or 32-bit on a normal PC architecture and then convert it to 8 bit for the Arduino.
If you haven't written cryptography algorithms before I would be very impressed if you manage to pull this off within 12 months with an Arduino.

Sorry to put a downer on this idea, but you have to start small and work your way up - jumping in at the deep end and drowning is the best way to put someone off swimming.

If you're determined to do this, try implementing first ElGamal encryption, or the Digital Signature Algorithm (DSA), which both use discreet logarithms.

- Tim
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 654
Posts: 35023
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I believe that is not possibile...just 8 bit cpu.

The number of bits in a CPU is totally irrelevant as regards to actually doing a problem. You might be defeated by the amount of memory it takes or the speed in which you can complete it but doability is not a function of CPU data bus width.
Logged

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Plus the diecimila only has 512bytes of memory
FWIW just to be pedantic it's actually 1024 bytes of RAM. There's 512 bytes of EEPROM.

--Phil.
Logged

Australia
Offline Offline
Full Member
***
Karma: 0
Posts: 100
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try twofish. It was designed to be implemented on 8-bit hardware, and needs only 36 bytes of RAM (if the key is stored in EEPROM).

Try this search for more info.
Logged

Connecticut, US
Offline Offline
Edison Member
*
Karma: 2
Posts: 1036
Whatduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Try twofish.

I looked at the C code to implement it.  Just guessing from my short peek at it, but the code itself might fill the whole ATmega168 and more.  I will see what parts really need to be there.  It would be kinda fun to make an "Ardufish device," huh?
Logged

Pages: [1]   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: