crypto af_alg blackkey demo can hardware decrypt data, how to encrypt?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

crypto af_alg blackkey demo can hardware decrypt data, how to encrypt?

跳至解决方案
2,100 次查看
flobro
Contributor III

How can we encrypt data/file using a black key instead of using openssl like in the demo?

 

Does not seem to be an example for encryption, only decryption (caam-decrypt )...

Is there a "caam-encrypt" demo?

0 项奖励
1 解答
2,026 次查看
flobro
Contributor III

The answer is to use libkcapi for encryption/decryption.

https://github.com/smuellerDD/libkcapi

Otherwise you are going to have roll your own bucket brigade to encrypt a file. It works great and can use the CAAM hardware enc/dec.

在原帖中查看解决方案

0 项奖励
6 回复数
2,027 次查看
flobro
Contributor III

The answer is to use libkcapi for encryption/decryption.

https://github.com/smuellerDD/libkcapi

Otherwise you are going to have roll your own bucket brigade to encrypt a file. It works great and can use the CAAM hardware enc/dec.

0 项奖励
1,708 次查看
petemccollister
Contributor I

Hey there! I'm new to this forum, and I noticed that your question has already been answered, but I wanted to share something that I recently discovered. Have you checked out the EUR/USD live chart? It's a really helpful tool for tracking currency exchange rates, and it might be useful in your work with encryption/decryption.
BTW, it's great to see that there are tools like libkcapi available to make encryption and decryption easier. I'm always on the lookout for helpful resources and tools, so I thought I'd share this one with you.

0 项奖励
1,698 次查看
floydbrown
Contributor I

I'm sorry, I have no idea what you are referring to

 

0 项奖励
2,081 次查看
Harvey021
NXP TechSupport
NXP TechSupport

Hi @flobro 

Here is the link providing demo for you reference. README.txt\demo-caam-blobs - imx_sec_apps - i.MX Security Application Examples (codeaurora.org)

 

Best regards

Harvey

0 项奖励
2,061 次查看
flobro
Contributor III

I might also add there is a problem with the patched code when trying to "decap" a red key...

You get a "caam_jr 30902000.jr: Decapsulation job failed" message and the returned value is the same as the encapped value.

 

There are other messages in the forum about this, just search for "Decapsulation job failed" and you will see them. They have gone unanswered.

 

I do not see why NXP did not preserve the wrap/unwrap feature that is in the IMX6 kernel drivers, and also have a driver that fails. Code compatibility should be paramount and lead to people using the newer products when you do not have to re-engineer a bunch of code.

0 项奖励
2,075 次查看
flobro
Contributor III

caam-blobs is completely different than af_alg blackkey demo. al_alg is linux Crypto API for  userspace that uses caam-decrypt where caam-blobs is a patch tp applt to the kernel which appears to have some issues (I think it was for an older kernel version). It patches, but you get messages about some failures.

 

Meanwhile I found out how to encrypt by modifying the sample in https://lwn.net/Articles/410833/. Also look at libkcapi for a wrapper around the Crypto API (see kcapi-enc utility)

0 项奖励