I would like to build a hardware encrypted (at least AES-128) pen drive for myself. Which micro controller and which storage technology do you recommend? I've been experimenting with a PIC32 and a 2GB SD memory, but the reading/writing throughput is not good.

Any suggestion would help.

Thanks in advance!

  • \$\begingroup\$ Maybe not a micro (unless it supported hardware encryption) but maybe an fpga? \$\endgroup\$ – Faken Jan 26 '12 at 15:11
  • \$\begingroup\$ @faken, many do. \$\endgroup\$ – Kortuk Jan 26 '12 at 16:14
  • \$\begingroup\$ Dedicated hardware is nice, but can you comment on the speeds you're achieving and how you're currently doing this? (Buffering, encryption method, storage/retrieval procedure, etc) Maybe someone can spot where an optimization can be made. \$\endgroup\$ – Jon L Jan 26 '12 at 23:56
  • \$\begingroup\$ @Jon L: Without encryption I'm achieving 950 KB/s of reading throughput (this is what GNOME reports when copying to my Ubuntu, is not the gross throughput), using SPI at 20MHz. Using the POLAR SSL AES-128 algorithm I get 330 KB/s. The Microchip encryption library page says 740 KB/s of throughput for decryption, so I would not expect more than that... \$\endgroup\$ – Federico Jan 27 '12 at 16:38

If you want to use a micro (a small FPGA would work well also) then one with a dedicated peripheral would be good.

The STM32F407 series have a cryptographic processor peripheral capable of DES, Triple DES, AES 128, 192 or 256.

They also have a dedicated SD card peripheral (for 1, 4 or 8-bit interface) which allows transfer at up to 48MHz.

You can grab hold of the discovery F4 dev board very cheaply on Mouser (probably a few other places too)

Note I haven't used either of the peripherals yet, I've just noticed them whilst using the chip (which is very powerful for the price) I have used the PIC32 plenty also but this is a step up, my only grumble is ST don't provide an IDE (plenty to choose from though - Keil, IAR, Rowley, Atollic - we went for Raisonance) and their documentation/code examples are not as good as Microchips.

  • \$\begingroup\$ Appreciate your answer. Could you please recommend me some storage technology for this? I was using an SD, interfaced with SPI, but the protocol makes the transfer really slow (around 950 KB/s), in comparison to a standard pendrive. I was thinking also on using compact flash or directly writing (or using a chip, I don't know) a NAND flash controller. \$\endgroup\$ – Federico Jan 26 '12 at 23:19
  • \$\begingroup\$ I'd probably use the parallel SD interface and/or grab a faster SD card. The STMF4 SD peripheral doesn't use SPI (rather the parallel interface), and having a quick glance at the datasheet I think it takes care of the SD protocol for you. At 48MHz and up to 8-bits per clock cycle, that gives you up to 48MB data rate (minus some for protocol) I would have a look at the SDIO section of the STM32F07 reference manual, and check if ST have some example code on their site (most likely) \$\endgroup\$ – Oli Glaser Jan 27 '12 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.