The Atmel® ATSHA204 is a full turnkey security device. It includes a 4.5Kb EEPROM divided into 16 slots. This array can be used for storage of keys, miscellaneous read/write, read-only, password or secret data, and consumption tracking. Access to the various sections of memory can be restricted in a variety of ways and then the configuration locked to prevent changes.

Access to the chip is through a standard I²C interface at speeds up to 1Mb/sec. The chip also supports a single-wire interface that can reduce the number of GPIOs required on the system processor and/or reduce the number of pins on connectors. It is compatible with most UART or serial I/O controllers. System integration is eased with a wide supply voltage range and an ultra-low sleep current of less than 100nA.

参数                                值
Operating Voltage (Vcc): 2.0 to 5.5
Interface Type: Single-wire; I2C
Density: .5Kb
Algorithm Type: NIST SHA-
Key Size:
Zones:

http://www.atmel.com/zh/cn/Images/Atmel-8740-CryptoAuth-ATSHA204-Datasheet.pdf

爱特梅尔公司(Atmel Corporation)发布具有增强的硬件安全特性和更大灵活性的易于使用的新型加密认证(cryptographic authentication) 器件。

具有超低功耗的Atmel ATSHA204是首款带有4.5Kbit EEPROM和硬件SHA-256加速器的经优化的交钥匙认证器件,

其经过全面测试的ASF软件库可用于基于Atmel AVR  和 ARM的微控制器 ,并集成在全新集成式开发环境AVR Studio 5 中。

ATSHA204器件是工业、消费电子、电力抄表、家庭自动化、计算和医疗应用的理想选择。

全新爱特梅尔 CryptoAuthentication器件具有保护EEPROM内容的增强安全特性,包括有源金属护罩、内存加密、安全测试模式、

干扰保护(glitch protection)和电压篡改检测。其设计采用与爱特梅尔Common Criteria Certified TPM相同的方法和组件,并内置高质量随机数据发生器,

可用于加密协议以防止重放攻击(replay attack)。ATSHA204还结合了许多其它的内部硬件保护特性,极大地增加了针对OEM电池、

游戏控制台、打印机墨盒、经授权附件等装置中安全器件进行硬件攻击而得逞的难度。

爱特梅尔CryptoAuthentication系列 的新成员具有专门设计的经优化的硬件安全特性,以鉴别目标、控制OEM供应链、防止软件或其它知识产权(IP)的盗窃。

这款器件能够安全地生成、存储或传送安全密钥,因而可与微控制器系统中的AES加速器理想配合。

由于新器件具有256位密钥,安全度超过市场上的其它任何认证器件,系统设计人员能够有信心保证其设计在系统的整个寿命周期中安全可靠。

爱特梅尔公司加密产品业务部总监Kerry Maletsky表示:“爱特梅尔致力于提供易于使用,且集成最新NIST加密算法以实现具最高级别可靠性的加密产品。

这些产品填补了大多数微控制器和ASIC解决方案的安全存储缺失的空白,可用于组件确认、固件完整性检查、专有和保密数据的安全存储等。

而且,这些器件的使用非常方便,应用开发人员无需具备加密知识,也能够自信地实现认证检查功能。”

价格和供货

爱特梅尔公司提供采用行业标准SOT-3、SOIC-8、UDFN-8和TSSOP-8封装的ATSHA204器件,带有单线或I2C接口。订购1000片的单价为0.41美元。

ATSHA204 加密认证芯片数据格式

http://www.andlogic.net/news_con.asp?ID=76

Atmel ATSHA204是带有4.5Kbit EEPROM和硬件SHA-256加速器的安全认证器件,包括有源金属护罩、内存加密、安全测试模式、

干扰保护(glitch protection)和电压篡改检测。其设计采用与爱特梅尔Common Criteria Certified TPM相同的方法和组件,

并内置高质量随机数据发生器,可用于加密协议以防止重放攻击(replay attack)。

由于该芯片技术文档对命令和响应的数据格式没有说明,只能从demo程序中分析出来,总结如下:

IIC总线设备地址:TWIAddress:0xc8

唤醒

ATSHA204芯片被唤醒信号触发后,需要读取其状态,只有在唤醒状态才能进行进一步操作,读取唤醒状态命令格式和波形:
0xc9,0x04,0x11,0x33,0x43

完整的写命令举例

C9,04,11,33,43 {C9:读,04:count,11:wake token 33,43:Checksum }

C8,03,0B,12,00,00,00,00,00,00,00,A7,BF {C8:写,03:Command ,0b:count, 12:write , A7,BF: Checksum }

C9,04,03,83,42 {C9:读,04:count,03:Parse Error, 83,42:Checksum }

C8,02 {C8:写,02:Idle }

ATSHA204

http://blog.csdn.net/sannik/article/details/8022186

主要特性:
1,SHA-256 Hash算法
2,有保证的唯一的72-bit序列号; 不仅有软件加密,内部还有高质量硬件加密。
3,16个槽口的4kbits EEPROM:  4Kbits / 8 = 512Bytes 每个槽口32bytes
4,I2C接口, 单线接口
5, 和Atmel AT88SA102S,AT88SA10HS
6, i2c 地址默认为0xc8; 还可以configuration zone改变地址。

开发环境: s5pv210 linux,  imx51 linux

操作流程:

==>烧录工具:研究烧录工具的使用,能够更快的熟悉芯片功能。

芯片使用之前可导入个性化文件,配置slot/otp data的读写权限以及验证方式。配置完成后再lock住 config zone和data zone;

这样对芯片的个性化配置完成了,从此芯片就会按照你的意图办事拉。

SlotConfig (32bytes,  2bytes per slot):

ReadKey - 该slot数据的读,用指定ReadKey的slot加密起来;

CheckOnly - 该slot是否只适用CheckMac and GenDig Command;

SingleUse - single-use keys,若enable,使用次数限制后会返回出错;

EncryptRead, slotconfig.IsSecret都为0,此slot才能被读写。然后OTP/data zone必须locked,才能读写。

UseFlag  -  对应single-use keys, 表示该key可以使用多少次;只针对keys #0~7设置。

OTPmode = 0xAA, OTP zone locked: 写被禁止,读任意。

==>代码部分:

1, wakeup device: 6.1.1 -- chip is asleep.

和芯片通信之前要确保它是awake。只能当chip asleep才能唤醒,芯片处于awake时忽略唤醒命令。

sha204c_wakeup()

具体唤醒芯片有两种方式:

1),将SDA配成gpio口,给出60us低,然后拉高2.5ms;条件是clk较高:samsung 400KHz

2),利用标准i2c发送函数,发送0x00 byte给出60us,然后延时2.5ms;条件是clk较低:imx51 200KHz

sleep sequence:  sha204c_sleep()  已验证;

2,  read write:

读写要确保芯片的各个区是否有相应的权限。

config zone一直有读的权限,OTP zone通过设置也可任意读;

slot data由slotconfig决定读写的权限。可以直接读,认证读,认证写 ...

Read Command:
* read config zone简单,config zone的内容一直可读的;
* 读取data slots的内容有条件:(此步骤由烧录工具完成)
先通过lock command设置slotconfig unlocked 和 data zone locked;
然后通过write command配置SlotConfig(config zone的20~51字节,每个slot占用2个字节);
读写data zone的权限都是要设置slotconfig的。

Write Command:
* 通过写SlotConfig来设置读写data zone的权限。同时,写config zone的slotconfig区间前,
  需要确定slotconfig是unlocked(看Lock Command)。(此步骤由烧录工具完成)
* 写data slot;

Lock Command: (此命令由烧录工具调用的,驱动代码中无需调用)
* 设置slotconfig区间的写权限;写:unlocked详见config zone的 87 byte
* 设置OTP zone和data zone的写权限。读:locked;写:unlocked 详见config zone的 86 byte
只能unlocked -> locked,所以要先write,再read data zone。

Config zone: 88bytes   
格式: cnt + data + CRC
0~31: 参数 -- 0x80, 0x0000
1 23 6c 3e 0 4 5 0 94 9d e4 d2 ee 55 1 0 c8 0 55 0 |8f| 80 80 a1 82 e0 a3 60 94 40 a0 85
32~63:参数 -- 0x80, 0x0008
86 40 87 7 f 0 89 f2 8a 7a b 8b c 4c dd 4d c2 42 af 8f ff 0 ff 0 ff 0 ff 0 ff 0 ff 0
63~87:只能4-bytes读,不能一次读32-bytes。
84~87byte:参数 -- 0x00 0x0015
0 0 55 55

OTP zone:64bytes

它的读写权限由OTPmode控制。0xAA -- read-only mode。 可以通过READ COMMAND读出。

Data zone:16 * 32bytes

3,i2c sync:

系统如果芯片response不正确,要做一次reset!

sha204c_resync()。

目前此步骤在imx51,s5pv210平台均未实现;采取的是足够的延时(不同的命令,芯片的反应时间也不同)来保证芯片sync。

如何发送9clock的高电平呢?

4, 认证:

MAC Command

* sha204m_execute() mode 决定了参与计算MAC的各种参数:

第一个32bytes:Key[KeyID] or TempKey,  第二个32bytes:user input challenge or Tempkey.

(1) 随机数认证:

mode=0, Key[KeyID] + challenge; 直接执行MAC Command命令; 得到SHA-256 MAC值。

user 通过SHA-256算法计算出的MAC和上述MAC对比来认证。

e.g.> MAC Command Sent: 27 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 BB 97

MacCommand Received: 23 84 09 C2 A7 31 81 83 51 16 EE E1 AD 5F 59 4B EC 63 B8 5E E6 D7 8A 3F EE 26 5E 90 AD 15 B7 D0 0A DC 60

/* user验证 */ 计算MAC并比较:slot data + challenge => MAC

(2) Tempkey认证: mode = 1 & tempkey.SourceFlag.Key[KeyID] + Tempkey

须先要执行Nonce Command生成Tempkey。然后执行MAC Command;得到SHA-256 MAC值。

Nonce Command:

user input challenge + chip internal Randout  => Tempkey

Tempkey register: 32bytes Data + Tempkey Config [ 理解SourceFlag ,  Valid 意义]

tempkey.SourceFlag 标志着; Tempkey.Valid 表示其是否可用:

nonce命令执行后,该标志为1;tempkey被用过之后,标志变成了0.

CheckMac Command:

e.g. >Nonce Command Sent:   1B 16 00 00 00 54 79 70 65 20 43 68 61 6C 6C 65 6E 67 65 20 48 65 72 65 00 17 13 //执行Nonce command

NonceCommand Received:  23 A6 5A D5 07 A9 81 D7 E1 B0 5F 2D 73 44 72 94 74 AE E6 BC BB 94 BF 73 47 5F 65 F8 A4 6B 47 B8 FB 59 06 //返回芯片内部的Randout; 此时,Tempkey已经生成

MAC Command Sent:     07 08 01 00 00 06 67 //执行MAC command:mode=1,keyid=0(slot0 data + tempkey)
MacCommand Received:  23 98 80 4C 73 13 2E 0F 89 BD A7 7C 69 28 C5 47 D1 BC DC 60 9A C1 A3 09 87 36 26 7C E9 D6 8B 19 10 56 F5 //返回SHA-256 MAC值

/* 下面的验证部分,实际需要由user完成的 */
CheckMac Command Sent: //执行CheckMac command验证   (方便分析,将数据分割下)

54 28 00 00 00   //mode=0, keyid=0
64 46 F3 95 6E FC 47 AF AC E6 E6 A8 67 09 16 F6 5B E1 F8 3A A0 4E 7B 79 67 9B A3 94 FF ED 9F B5      //user input challenge, 就是tempkey
98 80 4C 73 13 2E 0F 89 BD A7 7C 69 28 C5 47 D1 BC DC 60 9A C1 A3 09 87 36 26 7C E9 D6 8B 19 10  //sha-256 MAC
08 01 00 00 00 00 00 00 00 00 00 00 00  //other data:  和MAC command发送的“07 08 01 00 00 06 67” I/O block相同,补全13字节。
9E C6
CheckMacCommand Received: //返回匹配结果
04 00 03 40
##注意CheckMac命令格式##

/* user 验证 */

计算Tempkey: Nonce 命令的输入challenge(20bytes) + 其返回值Randout  => Tempkey

计算MAC并比较:slot data + tempkey => MAC

===>   疑问: 不知道slot 的配置是否影响到上述两种认证方式。

目前验证,随机数的认证不受slotconfig的影响。

* Personalize the device as follows:

*- Slot 0  = Store read-only information e.g. model number, product name, product ID, manufacturer name, or ?? (teach me how).    <可用read command直接读到>
*- Slot 1  = Store authentication/encryption key.
*- Slot 2  = Store authentication/encryption key.
*- Slot 3  = Store fixed key with "single use" restrictions having 5 maximum uses.
*- Slot 4  = Store key that can be created in the field with 3 maximum authenticated updates. Use KeyID 1 for authentication
*- Slot 5  = Store key that can be rolled in the field with 6 maximum authenticated updates. Use KeyID 2 for authentication
*- Slot 6  = Store content that requires encrypted read/write using KeyID 3 for READ and KeyID 4 for write
*- Slot 7  = Make this slot write-only (Suggest possible use for this?)
*- Slot 8  = Make this a scratch pad e.g. unrestricted reads/writes
*- Slot 9  = Store content that requires encrypted reads using KeyID 1 but clear writes.
*- Slot 10 = Store content that requires encrypted writes using KeyID 2 but clear reads. 
*- Slot 11 = Store key that can be created in the field with MAC required for creation. Use KeyID 2 as parent key.
*- Slot 12 = Store key that can be created in the field by anybody i.e. without requiring MAC 
*- Slot 13 = Store key that can be rolled in the field with MAC required for rolling. Use KeyID 2 as parent key.
*- Slot 14 = Store key that can be rolled in the field by anybody i.e. without requiring MAC
*- Slot 15 = Store key with 33 maximum uses controlled by UseFlags.  Make it a CheckOnly Key

ATSHA204加密认证IC的更多相关文章

  1. Linux的加密认证功能以及openssl详解

    一.详细介绍加密.解密技术 现在的加密/解密技术主要有三种:对称加密,非对称加密,和单向加密 这三种加密解密技术的组合就是现在电子商务的基础,它们三个有各自最适合的领域,而且所要完成的功能也是不同的, ...

  2. 《LDAP服务器和客户端的加密认证》RHEL6——第二篇 运维工程师必考

    服务端的配置: (基于原先配好的ldap服务器)打开加密认证: Iptables –F  setenforce 0 1.编辑ldap的配置文件:slapd.conf 2.启动ldap服务器: 3.切换 ...

  3. DNS递归查询、主从、加密认证、负载均衡

    环境同DNS练习之正向解析. 在sishen64主机上安装必要软件 [root@sishen64 ~]# yum install -y bind bind-chroot bind-libs bind- ...

  4. Apache的安装部署 2(加密认证 ,网页重写 ,搭建论坛)

    一.http和https的基本理论知识1. 关于https: HTTPS(全称:Hypertext Transfer Protocol Secure,超文本传输安全协议),是以安全为目标的HTTP通道 ...

  5. 告别山寨数据线:USB Type-C加密认证出炉

    从去年苹果发布的MacBook首次采用USB Type-C接口开始,这一标准逐渐成为主流,许多旗舰手机慢慢地采用了这种接口.今日,非盈利机构USB开发者论坛(USB-IF)宣布了USB Type-C认 ...

  6. Android客户端与服务器端通过DES加密认证

    转载地址:http://blog.csdn.net/spring21st/article/details/6730283 由于Android应用没有像web开发中的session机制,所以采用PHPS ...

  7. 【HTTPS双向加密认证】

    HTTPS单向认证和双向认证 nearzk-osc 发布时间: 2015/07/30 15:27 阅读: 4177 收藏: 178 点赞: 6 评论: 3 一.背景&概念 HTTPS:在htt ...

  8. AK/SK加密认证

    AK/SK认证的实现 AK/SK概述 1.什么是AKSK ak/sk是一种身份认证方式,常用于系统间接口调用时的身份验证,其中ak为Access Key ID,sk为Secret Access Key ...

  9. 7.openldap使用ssl加密认证

    作者:yaoyao 1.服务器端部署 1.自建CA中心 1.CA中心生成自身私钥 #cd /etc/pki/CA #(umask 077; openssl genrsa -out private/ca ...

随机推荐

  1. IOS公司开发者账号申请详细教程

    谈到苹果开发者账号,我们需要区分一下个人账号.公司账号和企业账号这三种,还有一种是教育账号,这个就不多说了. 个人账号:个人申请用于开发苹果app所使用的账号,仅限于个人使用,申请比较容易,$99. ...

  2. hdu 1969(二分)

    题意:给了你n个蛋糕,然后分给m+1个人,问每个人所能得到的最大体积的蛋糕,每个人的蛋糕必须是属于同一块蛋糕的! 分析:浮点型二分,二分最后的结果即可,这里要注意圆周率的精度问题! #include& ...

  3. Android 所有版本区别总结(转)

    Android 1.0 第一版商用操作系统 Android 1.1 更新了部分API,新增一些功能,修正了一些错误,同时增加com.google.android.maps包 Android 1.5 智 ...

  4. 企业高并发的成熟解决方案(一)video(笔记&知识点)

    知识点 答案 什么是高可用(HA) 高并发发生在哪两处 app服务器会出现什么问题,有哪些解决方案? 数据库并发有什么要求? hadoop集群的作用 负载均衡的功能有哪些 负载均衡的分类 哪种负载均衡 ...

  5. CMDB反思5

    ITSM工具规划设计 http://blog.vsharing.com/xqscool/A946789.html 相比PPT中被管的数个对象(像培训什么的也都在其中),我们的需求其实就要小得多,但是问 ...

  6. Real Boxing 2

    http://itunes.apple.com/ca/app/real-boxing-2/id932779605?mt=8&ign-mpt=uo%3D4

  7. C#开源框架(整理)

    http://www.cnblogs.com/chinanetwind/p/3715809.html http://www.cnblogs.com/chinanetwind/p/3715813.htm ...

  8. 使用Log.isLoggable方法

    在Audio Debug过程中想打开AudioService.java文件中的log,比如想打开setmode这段log: if (DEBUG_MODE) { Log.v(TAG, "set ...

  9. 挖坟之Spring.NET IOC容器初始化

    因查找ht项目中一个久未解决spring内部异常,翻了一段时间源码.以此文总结springIOC,容器初始化过程. 语言背景是C#.网上有一些基于java的spring源码分析文档,大而乱,乱而不全, ...

  10. 隐藏StatusBar 非setStatusBarHidden

    UIWindow * window = [[UIApplication sharedApplication].windows lastObject]; 隐藏 [window setWindowLeve ...