Custom compiling....

Posted on
  • I am on a mission to some how impliment aes128/256 and HMAC on the Espruino. There has to be a way to implement encryption. @Gordon I know you mentioned that it might be possible to impliment encryption by custom compiling Firmware. I started to search Google for away to add encryption and stumbled upon this guide: http://hobbymc.blogspot.com/2011/02/stm3­2-discovery-porting-polar-ssl.html?m=1 I have never played around with the Espruino firmware and was wondering what tools and software I will need to possible attempt what is explained in the guide? I do know the guide explains what tools are needed, but I am not sure if I will need different tools or what? Also is there a tutorial on the website for custom compilation?

  • This is available in Espruino https://github.com/espruino/Espruino/tre­e/master/libs/hashlib
    Reference: http://www.espruino.com/Reference#HASH
    I thought you had to compile custom hardware but this line makes me wonder @Gordon..?


    EDIT: a bit too quick to the keyboard there... This is SHA not AES, silly me.
    For adding a new library, see this tutorial :)

  • SHA-224/256/384/512 will work for the signature :). Now, it depends on whether AES128 or 256 can work which I guess will depend on memory consumption. I was able to implement encryption on a LPC1768 mcu which only has 32KB RAM, 512KB FLASH. The Espruino board has RAM 48 kBytes, Flash 256 kBytes
    The Pico has 384kb flash, 96kb RAM. So, perhaps the Pico will be better suited for encryption?

  • You could offload the hashing to an external µCU maybe? Then talk to it via serial/i2c/whatever.

  • Ya, I thought about that. Maybe make an Ecryption breakout board designated only for crypto. For example: https://www.sparkfun.com/products/12773 The CryptoCape is for the beagle bone black. The Cape is rather large and I would most likely need a smaller breakout board. I've been thinking about a crypto project for a while now, but I haven't had the time to sit down and research the subject in depth. For all I know, there already might be a crypto project out there like the cryptocape.

  • Regarding setting up the toolchain: There's a thread somewhere on these forums where it's described in some detail. I think it was last posted in around mid december, when I discovered that the old compiler I was using for bigram didn't work anymore.

    If you're familiar with AWS, I've shared an AMI with tested compiler toolchain - ami-1ce28974 (if that happens to be more convenient than setting it up on your own linux box)

  • I'm not familiar with any of this :/ the only experience I have with microcontrollers is the arduino and mbed platform where you import a library and etc then press compile. I do remember the big ram post. I will do a search and hopefully figure this out.

  • The first step would be building Espruino yourself. There's some info on the GitHub page. I've just merged in some information about 'Vagrant' from @boneskull - you could give it a try - it appears to be a way to automatically set up the image you'd need to build Espruino with.

    Actually adding functions to Espruino once that is done is quite easy - however you may find it slightly trickier if PolarSSL wants access to functions that can real/write to a socket.

    In terms of porting PolarSSL yourself - you should be able to make it fit, but you might have to lower the amount of 'variables' used by Espruino in the boards/ESPRUINOBOARD.py file to give you enough RAM for it.

    Are you thinking of using it with WiFi? It might be worth doing some research into the ESP8266 and SSL - surely someone must have implemented it in the ESP8266 itself by now. If so it'd be perfect.

  • @Gordon I was thinking about encryption for both ethernet and wifi. I am trying to take the route with the least resistance, so Wifi might be the better option for me to start with and see what kind of results I find.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Custom compiling....

Posted by Avatar for d0773d @d0773d

Actions