Linux Kernel(Android) 加密算法总结(cipher、compress、digest)文章中。介绍了怎样在内核中增加三种不同类型的内核加密算法, 并给出了在内核模块中怎样调用他们的实例。

本文将主要介绍,怎样在应用程序空间中(user space) 调用内核空间(kernel space)加密模块提供的加密算法API。


方法一:通过调用crypto: af_alg - User-space interface for Crypto API, Herbert Xu <herbert@gondor.apana.org.au> 2010年,给内核2.6.X 接口实现

详细情况请參考Linux Kernel(Android) 加密算法总结(二)- A netlink-based user-space crypto API


以下依据以上方法实现应用程序调用内核加密算法接口演示样例:

该方法经过在内核层实现与CPU加密模块。或者硬件加密卡对接,并为上层应用程序提供接口的方式。能够实现硬件加密。


应用程序调用内核 hash

hash.c

Andrid.mk


编译完毕后在

adb push testhash /system/bin/

adb shell chmod a+x /system/bin/testhash

adb shell testhash

验证输出结果.


版权声明:本文博主原创文章。博客,未经同意不得转载。

相关文章:

  • 2021-09-20
  • 2021-08-30
  • 2022-12-23
  • 2021-12-06
  • 2021-04-11
  • 2022-12-23
  • 2021-06-04
猜你喜欢
  • 2021-07-23
  • 2021-12-26
  • 2021-08-10
  • 2022-12-23
  • 2021-12-06
相关资源
相似解决方案