AES, DES的实现

在Cortex-m3上实现AES或DES算法

DES

It was once a predominant symmetric-key algorithm for the encryption of electronic data.

AES

For AES, NIST selected three members of the Rijndael family, each with a block size of 128 bits, but three different key lengths: 128, 192 and 256 bits.

那DES和AES选择哪一个呢?

根据资料,DES较老,AES的速度和可靠性方面更好些,所以选择AES吧。

另一个角度,为什么UDP包在Wifi网络上是不加密的呢?

As far as I understand, WiFi networks that require no password send traffic through the air unencrypted. Those that require a password encrypt each connection uniquely, even if they’re all using the same password.

If this is true, I don’t understand why. Requiring a password for access and encrypting connections seem like totally separate issues.

合理解释了这个问题。因为连进同一个路由器的设备在链路层上是没有任何加密的,所以我们要在应用层上加上加密步骤。

AES的实现

步骤解释
substitution字符替代
permutation字符打乱,分散

10 rounds for 128-bit key

加密

步骤解释
Key expansion生成 Key Schedule, expanding a short key into a larger key, whose parts are used during the different iterations.
SubBytes
ShiftRow
MixColumnz
Add Round Keys

解密

步骤解释
Inverse Shift Row
Inverse SubBytes
Add Round Key
Inverse Mix Column

补充:

The last round for encryption does not involve the “Mix columns” step. The last round for decryption does not involve the “Inverse mix columns” step.

使用CBC mode. 但是当前的应用的话,使用ECB mode也没有什么问题。在Github上找到了一个范例,在Mac OSX上编译成功了。下一步再把代码移植到Cortex-M3环境。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值