搜索
bottom↓
回复: 37

关于STM32 的 RSA + AES加密算法

  [复制链接]

出0入0汤圆

发表于 2014-8-8 16:28:58 | 显示全部楼层 |阅读模式
请问一下各位  用STM32做1024位的RSA算法  是否可实现  
是应用在网络通讯上面的    密钥交互部分是用RSA算法  获取密钥OK之后用 AES加密算法   对所有网络通讯数据进行加密解密操作  并带有MD5校验

麻烦帮忙分析一下  谢谢

阿莫论坛20周年了!感谢大家的支持与爱护!!

月入3000的是反美的。收入3万是亲美的。收入30万是移民美国的。收入300万是取得绿卡后回国,教唆那些3000来反美的!

出0入0汤圆

 楼主| 发表于 2014-8-8 19:00:08 | 显示全部楼层
AES算法已经移植进去了  可以使用  
为什么我RSA算法 一加进去  程序都跑不起来呢。。。

出0入0汤圆

 楼主| 发表于 2014-8-9 10:40:16 | 显示全部楼层
麻烦有了解的帮忙回答一下  谢谢了

出0入0汤圆

 楼主| 发表于 2014-8-11 11:11:53 | 显示全部楼层
有人在知道怎么弄吗  谢谢了

出0入0汤圆

发表于 2014-9-28 09:03:25 | 显示全部楼层
同样的,我用STM32做2048位的RSA进行签名时,程序就跑不到了,根据log,一直在循环里,出不来了。

出0入0汤圆

发表于 2016-9-3 23:03:03 | 显示全部楼层

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2016-9-3 23:11:25 | 显示全部楼层
https://realtimelogic.com/products/sharkssl/Cortex-M3/

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2016-9-3 23:17:09 | 显示全部楼层
http://www.maojet.com.tw/product ... 0-8a7d-00e0814d9d67

       
The RSA Software Library IP is a library of embedded software optimized for maximum throughput and minimum memory utilization. The RSA Software Library IP include high-end software counter-measures against side-channel attacks and fault-injection attacks.

The RSA Software Library IP can run in stand-alone mode and can also run in conjunction with INVIA's Modular Exponentiation IP that provides hardware acceleration of  cryptographic calculations. It is recommanded to use the Modular Exponentiation IP with processors that do not have a 32x32 multiplier.

The cryptographic functions performed by the RSA Software Library IP are RSA  ciphering, deciphering, signature verification and signature generation. The RSA Software Library benefits from the Chinese Remainder Theorem(CRT)for maximum efficiency. Note that the countermeasures against fault-injection are very efficient even when the CRT is used during calculation.

The RSA Software Library is performance-optimized for the SPARC V8 LEON2 MCU and  for the ARM CORTEX M3 MCU. It is delivered as a binary or in assembly source code. It is structured as independent API modules

Highlights
 ‧ Available on ARM CORTEX M3 and SPARC LEON2
 ‧ RSA 2048-bit  deciphering:193ms on ARM Cortex M3 at 100 MHz in stand-alone mode
 ‧ Stack size:RSA 2048-bit requires only 1kB on ARM Cortex M3
 ‧ Code size:8kB on ARM Cortex M3


Security
 ‧ Designed to resist the most advanced techniques of side-channel analysis and fault-injection attacks
 ‧ Processing atomicity, data whitening, randomization(*) against side-channel attacks
 ‧ CRT recombination and verification against fault-injection attacks

Deliverables
 ‧ Binaries or Assembly source code for RSA functions
 ‧ Binaries or Assembly source code for low-level API leaf functions
 ‧ C source code examples of use of the libraries

出0入0汤圆

发表于 2016-9-3 23:42:01 | 显示全部楼层
STM32 Cryptographic Library UM0586 User manual





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2016-9-3 23:53:11 | 显示全部楼层
谢谢 shangdawei

这个资料很详细呀,RSA真的好占用资源,太复杂复杂了。

出0入0汤圆

发表于 2016-9-4 00:35:03 | 显示全部楼层
RSA Cryptography Standard

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2016-9-4 00:51:15 | 显示全部楼层
本帖最后由 shangdawei 于 2016-9-4 00:52 编辑

The first processor is available in a low cost ST development system, the STM32-PerformanceStick.
This provides a Cortex-M3 CPU running at 72 MHz with 128 KB of Flash and 20 KB SRAM [12].


The second test device was a Qualcomm 7200 running at 400MHz, under the Windows Mobile 6.0 operating system.

The last test device was a standard PC with a XEON CPU running at 3.2 GHz under Windows XP.
It is clear  that the only platform of interest in the automotive eld is the ARM Cortex, which is widely used for embedded applications.

The results on the other two processors, which are mainly used in hand-held and desktop devices (for the Qualcomm 7220 and the Xeon, respectively),
are provided just as a reference.







本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2016-9-4 11:39:59 | 显示全部楼层
shangdawei 发表于 2016-9-3 23:42
STM32 Cryptographic Library UM0586 User manual

也收到ST加密lib的邮件,没仔细看,不知道是不是免费的

出0入0汤圆

发表于 2016-9-4 11:55:16 | 显示全部楼层
RSA的运算量 本来就巨大, 还用m3…………

出0入0汤圆

发表于 2016-9-4 12:27:04 | 显示全部楼层
我就简单的说一个吧

你用RSA算法加密一下200个字节的数据试试  返回一个错误,所以我就没有用这个RSA了

出0入0汤圆

发表于 2016-9-4 13:01:32 | 显示全部楼层
STM32 cryptographic firmware library software expansion for STM32Cube (UM1924)

http://www.st.com/content/st_com ... cube-cryptolib.html

The STM32 cryptographic library package (X-CUBE-CRYPTOLIB) includes all the major security algorithms for encryption, hashing, message authentication, and digital signing, enabling developers to satisfy application requirements for any combination of data integrity, confidentiality, identification/authentication, and nonrepudiation.
The library includes firmware as well as hardware-acceleration functions for STM32 families. For more details refer to STM32 crypto library User manual (UM1924) at the www.st.com website.This firmware is classified ECCN 5D002.
Most of the well-used algorithms are certified according to the US Cryptographic Algorithm Validation Program (CAVP), helping customers to prove quickly and cost-effectively the security of their new products.The certified algorithms are: AES (3971), RSA (2036), ECDSA (874), SHS (3275), DRBG (1165) and HMAC (2589). Full details are available online at the NIST CSRC Algorithm Validation Lists website http://csrc.nist.gov, selecting the Cryptographic Algorithm Validation Program web page.
In this package there are examples for each algorithm and template projects for popular development tools including Keil®MDK-ARM™, IAR®EWARM (IAR Embedded Workbench®) and GCC -based IDEs such as Ac6 SW4STM32 and Atollic®TrueSTUDIO®.
Key Features
Supported NIST CAVP certified crypto algorithms:
AES-128, AES-192, AES-256 bits:
ECB (Electronic Codebook Mode)
CBC (Cipher-Block Chaining) with support for cipher text stealing
CTR (Counter Mode)
CFB (Cipher Feedback)
OFB (Output Feedback)
CCM (Counter with CBC-MAC)
GCM (Galois Counter Mode)
CMAC
KEY WRAP
XTS (XEX-based tweaked-codebook mode with cipher text stealing
HASH functions with HMAC support:
SHA-1
SHA-224
SHA-256
SHA-384
SHA-512
Random engine based on DRBG-AES-128
RSA with PKCS#1v1.5:
Encryption/decryption
Signature
ECC (Elliptic Curve Cryptography)
Key generation
Scalar multiplication (the base for ECDH)
ECDSA
Supported, but not certified, crypto algorithms included in the library:
ARC4
DES, TripleDES:
ECB (Electronic Codebook Mode)
CBC (Cipher-Block Chaining)
HASH:
MD5
HKDF-SHA-512
ChaCha20
Poly1305
CHaCHA20-POLY1305
ED25519
Curve25519

出0入0汤圆

发表于 2016-9-4 13:02:13 | 显示全部楼层
STM32 cryptographic library (UM0586)

http://www.st.com/en/embedded-software/stm32-cryp-lib.html

看起来有两个版本的加密库。

出0入0汤圆

发表于 2016-9-4 13:06:29 | 显示全部楼层
emSecure-RSA

https://www.segger.com/emlib-emsecure-rsa.html

emSecure-RSA is a fast solution to verify data on a microcontroller.

Data can be verified in less than 30 ms using a default key.

With smaller keys verification can even be done in less than 10 ms without using additional hardware.

Once a signature is generated, the signed data can be verified by its signature in an embedded application
or on an external application communicating with the device.

Verifying data takes less than 40 ms on a Cortex-M4, running at 200 MHz,
which is not significantly more time for a bootloader to start firmware.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2016-9-4 13:07:31 | 显示全部楼层

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出870入263汤圆

发表于 2016-9-4 13:50:55 | 显示全部楼层
可以实现的,参考mbedTLS或者wolfSSL

出0入0汤圆

发表于 2016-9-4 14:57:49 | 显示全部楼层
flea – Embedded Cryptographic Libray

http://cryptosource.de/product_flea_en.html

flexible, leightweight, and efficient algorithms

Our cryptographic software library flea (flexible leightweigt efficient algorithms) is tailored to the use in resource constrained devices.

Its main feature is a set of highly efficient implementations of public-key algorithms.

It is our aim to enable you to efficiently use cryptographic algorithms based on software implementations on low-cost 32-, 16-, and 8-bit standard platforms.

To this end, flea is available to you under two different licences: under the well known GPL v3 license and under the flea license ,
which allows you to use flea in your commercial closed-source applications without any licensing cost or other restrictions.

In order to reach this goal, the library is designed for flexibility.

It enables extensive configuration options in order to offer the optimal performance under all requirements.

To facilitate the seamless integration into your software framework, flea supports stack as well as heap memory allocations.

flea features high performance implementations especially of the public-key algorithms.

A 2048-Bit RSA signature generation or decryption on an ARM-Cortex-M3 @ 84MHz takes one second.



出0入0汤圆

发表于 2016-9-4 14:58:18 | 显示全部楼层








本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2016-9-4 15:16:58 | 显示全部楼层
What is mbed TLS?

mbed TLS is an open source and commercial SSL library licensed by ARM Limited..

mbed TLS used to be called PolarSSL, which started as the official continuation of another project, called XySSL, in 2008 and has been developed further ever since.

mbed TLS is supported by ARM with a young dynamic team which aims to keep customers happy with its straightforward and easygoing philosophy.

Download mbed TLS and PolarSSL

https://tls.mbed.org/download



mbed TLS supports a number of different cryptographic algorithms:

Ciphers

AES, Camellia, DES, RC4, RC5, Triple DES, XTEA, Blowfish

Cryptographic hash functions

MD5, MD2, MD4, SHA-1, SHA-2

Public-key cryptography

RSA, Diffie-Hellman key exchange,
Elliptic curve cryptography (ECC),
Elliptic curve Diffie–Hellman (ECDH),
Elliptic Curve DSA (ECDSA)



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2016-9-4 18:53:54 | 显示全部楼层
shangdawei 发表于 2016-9-4 14:57
flea – Embedded Cryptographic Libray

http://cryptosource.de/product_flea_en.html

给力!!收了,感谢!

出0入0汤圆

发表于 2016-9-5 15:16:17 | 显示全部楼层
看起来还不错,多谢了

出0入0汤圆

发表于 2016-9-5 17:43:49 | 显示全部楼层
不错,收藏一下

出0入0汤圆

发表于 2016-9-5 18:12:52 | 显示全部楼层
收藏了。。

出140入8汤圆

发表于 2016-9-16 14:40:27 | 显示全部楼层
417有硬件加密的

出0入0汤圆

发表于 2016-9-16 20:53:34 | 显示全部楼层
收藏了  

出0入0汤圆

发表于 2018-2-24 17:43:26 | 显示全部楼层

只有AES和DES的加密,并没有RSA

出0入0汤圆

发表于 2018-5-30 15:49:41 | 显示全部楼层
顶一下,准备使用RSA加密 。

出0入0汤圆

发表于 2018-6-4 11:29:33 | 显示全部楼层
MARK  RSA加密

出0入0汤圆

发表于 2018-6-5 13:02:26 | 显示全部楼层
MARK  RSA加密

出0入0汤圆

发表于 2018-6-5 14:55:21 | 显示全部楼层
RSA   收藏

出0入0汤圆

发表于 2018-6-5 15:05:41 | 显示全部楼层
收藏备用,RSA

出0入0汤圆

发表于 2020-6-15 09:03:58 | 显示全部楼层
做个标记,关于STM32 的 RSA + AES加密算法

出0入0汤圆

发表于 2020-6-18 11:56:17 | 显示全部楼层
这是个好东西,找了好久。

出0入0汤圆

发表于 2020-6-18 23:50:47 来自手机 | 显示全部楼层
rsa非对称,没内置hsm模块,很难跑起来
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-4-27 10:58

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表