C语言为Linux的公钥执行 [英] Public key implementation in C for Linux

查看:274
本文介绍了C语言为Linux的公钥执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用公共密钥加密签名,后来验证文件。该文件包含用户信息用于创作目的,一个简单的纯文本文件。

I'm trying to use public key crypto to sign and later verify a file. The file is a simple plaintext file that contains user information for authoring purposes.

我试了C实现公钥加密算法的不同地点,但我没有发现任何东西。很多站点指向使用证书(X.509等),但是这是远远超出我的需要。我只是在寻找一种方式来生成和公钥和私钥,并使用比较知名的算法进行签名和验证文件。

I tried different sites for a C implementation of a public key crypto algorithm but I haven't found anything. A lot of sites point to using certificates (x.509, etc) but that is way beyond what I need. I am just looking for a way to generate and public and private keys and use a relatively well known algorithm to sign and verify a file.

任何指针纯C实现了吗?重点是code,我可以重复使用,而不是外部库。主要的问题是,我不希望有才能有一个很基本的公共密钥系统对全lib和它的依赖链接。

Any pointers to a pure C implementation out there? The focus is on code that I can reuse and not external libs. The main problem being that I don't want to have to link against a full lib and its dependencies in order to have a very basic public key system.

感谢。

推荐答案

OpenSSL的是一个很好的封装。你可以只用密码库部分,它提供了基本的RSA实现。这可能是符合你在找什么。

OpenSSL is a very good package. You can just use the crypto library portion, which provides basic RSA implementations. That might be in line with what you are looking for.

Cryptlib 是另一种选择,可以为你工作。它有一些奇怪的许可问题的,所以考虑这些取决于你将如何使用它。

Cryptlib is another alternative that could work for you. It has some strange licensing issues though, so consider those depending on how you will be using it.

加密+ 是一组不同的加密技术,包括RSA,所以你可以试试。

Crypto++ is a set of different crypto technologies, and includes RSA, so you might try that.

最后,RSA是不是非常复杂,难以实施,所以你可以自己使用 GMP ,它提供你会必要的数学功能,即使实现它需要的。

Finally, RSA is not terribly complex to implement, so you could even implement it yourself using GMP, which provides the necessary mathematical functions you would need.

这篇关于C语言为Linux的公钥执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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