Linux中的公钥实现 [英] Public key implementation in C for Linux

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

问题描述

我正在尝试使用公钥加密来签名并稍后验证文件。该文件是一个简单的纯文本文件,其中包含用于创作目的的用户信息。



我尝试过不同的网站用于公钥加密算法的C实现,但是我还没有找到任何东西。许多网站指向使用证书(x.509等),但这超出了我所需要的。我只是寻找一种方法来生成和使用公钥和私钥,并使用相对较为熟知的算法对文件进行签名和验证。



任何指向纯C实现的指针在那里重点是我可以重用而不是外部库的代码。主要的问题是,我不想连接一个完整的lib及其依赖关系,以便拥有非常基本的公钥系统。



谢谢。 / p>

解决方案

OpenSSL 是一个非常好的包装。您可以使用提供基本的RSA实现的加密库部分。这可能与您正在寻找的一致。



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



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



最后,RSA不是实际上非常复杂,所以你甚至可以使用 GMP 自动实现,它提供了您需要的必要的数学功能。 / p>

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.

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.

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.

Thanks.

解决方案

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 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.

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

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.

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

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