保护 EEPROM 数据免遭修改
一般来说,我会通过在 ROM 映像中放置一些独特且随机的东西来解决此问题,并将其用作种子来加密 EEPROM 内容,以在映像修改后停止提取和重新编程。
一个明显的缺陷似乎是,这并不能阻止以空白芯片替换 EEPROM 外部芯片的形式进行篡改……哦,看看我们回到了第一次使用的状态,让我们请求密钥来保存!
选择组件对我来说不是一个选择,硬件平台已经定义了。 EEPROM 在器件的使用寿命期间随着配置和状态的变化而被编程,因此断开擦除线也是不行的。
我正在寻求有关可能的解决方案的意见,以防止伪造原始(首次运行)状态,因为这将允许保存敏感数据和解锁设备的功能。
我相信分组密码(ECB 模式)足以保护敏感数据,甚至可能是过度的! 这种方法加上多个副本,对一个副本而不是另一个副本进行加盐,应该会使投入金钱和时间来对抗这些措施在经济上变得无利可图。
Generally I would go about this by placing something(s) unique and random in the ROM image and use that as a seed to encrypt the EEPROM content to stop extraction and reprogram after image mod.
An obvious flaw seems to be that this doesn't stop tampering in the form of replacing the EEPROM external chip with a blank one... oh look were back to first time used state, lets ask for keys to save!
Selecting components is not an option for me, the hardware platform is already defined. The EEPROM is programmed during the lifetime of the device as configuration and state change so disconnecting the erase line is also a no-go.
I was seeking opinion on possible solutions to prevent the faking of a virgin (first run) state since this would allow functionality to save the sensitive data and unlock the device.
I am confident a block cipher (ECB mode) is sufficient to secure the sensitive data, maybe over the top! This approach along with multiple copies, salting one and not the other should make it financially unrewarding to place money and time to counter these measures.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将擦除引脚浮动并将整个芯片用环氧树脂固定到板上? 使用 PROM?
如果您不想修改图像,请使其无法修改。
Float the erase pin and epoxy the whole chip to the board? Use a PROM?
If you don't want the image modified, make it impossible to modify.
如果硬件措施不可行,而您却只能采用软件方法,那么读取 EEPROM 的东西就可以处理 公钥算法,那么您可以在 EEPROM 中使用公钥签名的数据块(获取您的 EEPROM 数据,在其前面添加一个包含数据长度和安全散列的固定块)使用私钥加密的数据)。
这需要任何使用 EEPROM 内容的东西用相应的公钥来验证它(显然不要将其放在同一个 eeprom 中)。 公钥算法的计算成本有点高,因此很难为微控制器证明这种方法的合理性。
如果您无法阻止人们篡改硬件,但您可以选择使用哪个硬件,您也可以使用安全 EEPROM,例如 Maxim DS28CN01(虽然我得承认,我讨厌 Maxim,因为他们的零件价格昂贵,交货时间长,而且在有足够多的人下订单之前通常都是汽件)供他们制造零件)或Atmel 的 AT88SC 系列。
If hardware measures are out, and you're stuck with a software approach, and the thing that reads the EEPROM can handle public-key algorithms, then you could use a public-key signed block of data in the EEPROM (take your EEPROM data, precede it by a fixed block containing the length of the data and a secure hash of the data that's been encrypted with the private key).
This requires whatever uses the EEPROM contents to validate it with the corresponding public key (obviously don't put this in the same eeprom). Public key algorithms are computationally kinda expensive so it's a bit tough to justify this approach for microcontrollers.
If you can't stop people from tampering with the hardware, but you can pick which hardware you use, you could also use a secure EEPROM, such as the Maxim DS28CN01 (although I gotta admit, I hate Maxim since their parts are pricey and have long lead times and are often vaporware until enough people put in orders for them to make their parts) or Atmel's AT88SC series.
一些想法:如果“防止修改”意味着您可以检测到此类篡改,那么您可以
但如果你想首先防止篡改,你必须使用机械防护装置 - 热熔整个芯片,锁定 PCB 的外壳,......
Some thoughts: if by 'securing against modification' you mean that you can detect such tampering, then you can
But if you want to prevent the tampering in the first place, you have to use mechanical guards - hot glue the whole chip, lock the housing of your pcb, ...