user78105: I'm working with this library AES lib so everything works I can encrypt/decrypt data. But now I'd like to know what is the best way to store my aes private key ? My boars is a personnal board build with an samd21 cortex M0+ my board doesn't have the possibility to connect with the extern world, like ethernet or ble, wifi.
I've only one possibility is to store the key in my program but what is the best way? Obfuscate my key? I know there is no perfect and secure solution if my key is store in my program, but what is the best solution ? Maybe is it possible to put my key when I upload my sketch in compiler option and store it in emulate eeprom?

user4143: All you can really do with your key is to just store it in your code. It makes no difference if that is as a const variable or stashed in emulated EEPROM.
The real question is not how to store it but how to stop someone reading it. Most microcontrollers (and the SAMD21 is no exception) have "code protection" facilities - settings you can enable in the chip's configuration (or "fuse") bits to prevent the flash being read by any external debugger or programmer.  By enabling these bits (check the datasheet for your chip) you will prevent people being able to read the flash containing your key no matter how you store it.

78105: <p>I'm working with this library <a href="http://utter.chaos.org.uk/%7Emarkt/AES-library.zip" rel="nofollow noreferrer">AES lib</a> so everything works I can encrypt/decrypt data. But now I'd like to know what is the best way to store my <code>aes private key</code> ? My boars is a personnal board build with an <code>samd21 cortex M0+</code> my board doesn't have the possibility to connect with the extern world, like ethernet or ble, wifi.</p>
<p>I've only one possibility is to store the key in my program but what is the best way? Obfuscate my key? I know there is no perfect and secure solution if my key is store in my program, but what is the best solution ? Maybe is it possible to put my key when I upload my sketch in compiler option and store it in emulate eeprom?</p>
 4143: <p>All you can really do with your key is to just store it in your code. It makes no difference if that is as a <code>const</code> variable or stashed in emulated EEPROM.</p>
<p>The real question is not how to store it but how to stop someone reading it. Most microcontrollers (and the SAMD21 is no exception) have &quot;code protection&quot; facilities - settings you can enable in the chip's configuration (or &quot;fuse&quot;) bits to prevent the flash being read by any external debugger or programmer.  By enabling these bits (check the datasheet for your chip) you will prevent people being able to read the flash containing your key no matter <em>how</em> you store it.</p>
