如何在cryptoAPI中添加更多的算法在linux [英] How can i add more algorithm in cryptoAPI in linux

查看:657
本文介绍了如何在cryptoAPI中添加更多的算法在linux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我检查/ proc / crypto它显示我:

When i check /proc/crypto it shows me:

abhi@ubuntu:/proc$ cat crypto 
name         : stdrng
driver       : krng
module       : kernel
priority     : 200
refcnt       : 1
selftest     : passed
type         : rng
seedsize     : 0

name         : md5
driver       : md5-generic
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
type         : shash
blocksize    : 64
digestsize   : 16

我需要为我的一个项目使用aes256。

I need to use aes256 for one of my projects.

有人可以指出我如何添加这个算法加密api或有任何其他方式,我可以实现(ubuntu 10.4,2.6.32-35)。

Can someone point out how I can add this algo to crypto api or is there any other way i can achieve this in (ubuntu 10.4, 2.6.32-35).

有一个支持的(默认)算法的列表,这些算法是使用cryptoapi为内核2.6实现的? p>

Is there a list of supported (by default) algorithms that are implemented with the cryptoapi for kernel 2.6?

推荐答案

Abhi,内核crypto API 在2002年创建了协议,这需要在内核内部的加密(在内核模式,当你没有可靠的方式使用用户空间加密):

Ab Kernel crypto API was created in 2002 for protocols, which requires cryptography inside the kernel (in the kernel mode, when you has no reliable way of using user-space crypto):


虽然最初的目标是支持IPSec,但是API被设计为通用设施,潜在的应用包括加密文件,加密文件系统,强大的文件系统完整性,随机字符设备/ dev / random),网络文件系统安全(例如CIFS)和其他需要加密的内核网络服务。

Although initially aimed at supporting IPSec, the API has been designed as a general-purpose facility, with potential applications including encrypted files, encrypted filesystems, strong filesystem integrity, the random character device (/dev/random), network filesystem security (for example, CIFS) and other kernel networking services requiring cryptography.

正在用户空间中工作,并没有计划迁移到内核作为新的FS或网络堆栈的新部分,它是更容易和更便于使用用户空间库加密。用户空间库可能对某些密码使用或不使用内核API,但可能会使用用户空间实现。有很多这样的库,例如。 openssl, Libgcrypt 等。一些巨大的框架,如Qt,也可能包括一些流行的crypto。

So, If you are working in the user-space and has no plans to move into kernel as new FS or new part of network stack, it is easier and more portable to use user-space library for crypto. User-space lib may use or not use kernel API for some ciphers, but likely it will use user-space implementation. There are a lot of such libs, e.g. openssl, Libgcrypt etc. Some huge frameworks, like Qt may include some popular crypto too.

要使用新的算法来扩展内核中的cryptoapi,您应该为您的内核(作为模块或作为内核二进制文件的一部分)实现和编译此算法。要查找为内核编译的模块名称,请尝试 ls / lib / modules / * / * / arch / * / crypto / / lib / modules / * / * / crypto / ;那么您可以调用 modprobe aes_generic modprobe aes-x86_64 在API中加载其他加密模块。

To expand cryptoapi in kernel with new algo you should have this algo implemented and compiled for your kernel (either as module or as part of kernel binary). To find name of modules compiled for your kernel, try ls /lib/modules/*/*/arch/*/crypto/ /lib/modules/*/*/crypto/; then you can call for example modprobe aes_generic or modprobe aes-x86_64 to load additional crypto module in API.

之后modprobe aes-x86_64 我有:

# cat /proc/crypto |grep aes
name         : aes
driver       : aes-asm
module       : aes_x86_64
name         : aes
driver       : aes-generic
module       : aes_generic

这篇关于如何在cryptoAPI中添加更多的算法在linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆