Re: Sorry for the uninteresting (AES) question.



On 14/08/2011 8:52 AM, Will Janoschka wrote:
On Sat, 13 Aug 2011 20:50:34, David Eather<eather@xxxxxxxxxx> wrote:

On 13/08/2011 11:41 AM, Will Janoschka wrote:
On Fri, 12 Aug 2011 19:38:32, David Eather<eather@xxxxxxxxxx> wrote:

On 12/08/2011 10:03 PM, Paulo Marques wrote:
Will Janoschka wrote:
On Fri, 12 Aug 2011 04:26:15, David Eather<eather@xxxxxxxxxx> wrote:
[...]
The hardware spec was given to me, it was not mine to choose or add to -
it is a PIC18.

That is a nice device very usefull!
The key will be embedded in the eeprom as will a message counter for a
nonce generator. Just what is the problem with that?

Putting a key in eeprom is like posting it on a billboard!

Could you please stop making up stuff?

The EEPROM is _embedded_ in the PIC itself (I would assume) so to get to
the key you need a serious hardware effort. Depending on the internal
chip construction, it can go from chip exposure + micro-positioning
probes to a ion beam. Certainly very different from a billboard.

This link might be of interest to some.
http://www.bunniestudios.com/blog/?page_id=40
PIC's are now protected from this hack.


David, I'm afraid I can't help with the AES code for PIC. From what I
remember from working with PIC's, they are terrible when it comes to RAM
(with all the banks and stuff).

Full agreement!

It's a pity you can't change the
hardware specification, since in these days you can get a Cortex-M0 at
$0.94 at 1k quantities from Digi-Key (568-5142-ND). That would be a nice
platform for a AES implementation (but I'm just tauting you, I guess).

I just wanted to give some advice about the counter in EEPROM, because I
had to do a similar thing in the past.

EEPROM's need to be erased before being written to. If you lose power in
the middle of such update (either accidentally or intentionally) the
contents of the EEPROM might end up with 0xFF.

The easy way to overcome this is to have several "slots" to store the
counter, spread the writes over them and count backwards. When you boot,
the counter with the lowest value is the good one and you can write the
next counter value in the slot with the highest value.

Also, to avoid burning down the EEPROM, you can use an algorithm like
this for the nonce:

- use a 64 bit counter: the upper 32 bits are kept in EEPROM and the
lower 32 bits are kept in RAM

- at boot, decrement the counter in EEPROM and use the new value for
the upper 32 bits of the counter

- _after_ you are sure the new value is stored in EEPROM, set the lower
32 bits to 0xFFFFFFFF in RAM and decrement away. Until the next boot you
don't need to write to EEPROM anymore

This assumes that you don't expect to do more than 2^32 reboots and
don't need more than 2^32 nonces between reboots. If that is not a
reasonable expectation, you may extend the algorithm to detect when the
lower 32 bits reach zero and decrement the EEPROM counter without a reboot.

The main point is: all along the way you have to think: what if an
attackers cuts the power at this point? And your algorithm must survive
that.

I know this is not the information you were looking for, but it might be
useful anyway. Good luck,


Great tips. Many Thanks

The Microchip site has info on KeyLoq and a $5 CD
that appears to have AES on it, I do not know if it has
a 8 bit version! -will-

After seeing this post and your post to PM I think you are disgracing
yourself rather heavily.

1. KeyLo*Q* is broken
2. KeyLoq is not available for a PIC18
3. Microchip subject the CD to export restrictions not required by the
US government.

Ok I thought that you were looking for help
on a project. not a troll My bad!


You suggested a broken algorithm, that is not available on the hardware I have to use, that is difficult or impossible for me to get.

What sort of help do you think you were offering?


.



Relevant Pages

  • Re: Sorry for the uninteresting (AES) question.
    ... The hardware spec was given to me, it was not mine to choose or add to - ... The EEPROM is _embedded_ in the PIC itself so to get to ... Also, to avoid burning down the EEPROM, you can use an algorithm like ... KeyLoq is not available for a PIC18 ...
    (sci.crypt)
  • Re: Sorry for the uninteresting (AES) question.
    ... The hardware spec was given to me, it was not mine to choose or add to - ... The EEPROM is _embedded_ in the PIC itself so to get to ... chip construction, it can go from chip exposure + micro-positioning ... Did you even search for PIC18? ...
    (sci.crypt)
  • Re: Sorry for the uninteresting (AES) question.
    ... The hardware spec was given to me, it was not mine to choose or add to - ... The EEPROM is _embedded_ in the PIC itself so to get to ... chip construction, it can go from chip exposure + micro-positioning ... Until you set the code protect bits. ...
    (sci.crypt)
  • Re: Sorry for the uninteresting (AES) question.
    ... The hardware spec was given to me, it was not mine to choose or add to - ... The EEPROM is _embedded_ in the PIC itself so to get to ... chip construction, it can go from chip exposure + micro-positioning ... Did you even search for PIC18? ...
    (sci.crypt)
  • maybe a bit OT: EEPROMs and PCs
    ... I was thinking about adapting a few old diskless PCs to serve me for some network / hardware interface stuff by changing the BIOS program. ... I got an old HW-9007 ISA RAM-EEPROM card with supporting programs, so I could write to the EEPROMs using that, but I'd preffer to buy myself something more for the purpose. ... My assembler makes .com files, to write to EEPROM I'll need properly alligned bits in raw .bin files. ...
    (alt.lang.asm)