linuxc加密
没有现成的,需要自己编写。
B. 如何在Linux下用c语言实现MD5/DES解密
相关库函数如下:
#include <openssl/md5.h>
unsigned char *MD5(const unsigned char *d, unsigned long n,unsigned char *md);
int MD5_Init(MD5_CTX *c);
int MD5_Update(MD5_CTX *c, const void *data,unsigned long len);
int MD5_Final(unsigned char *md, MD5_CTX *c);
C. 如何将Linux Shell程序使用shc编译加密
第一步非常简单,就是获取到
shc
程序的源码文件,这个可以从官方站点(现在视乎无法访问)下载,或者从参考资料里面提供的地址下载。
2
下载到源文件后,先要解压出来,使用Tarball工具进行解压,命令时
tar
-xvf
shc.tar
这样就能得到解压后的文件,。
3
这时候我们自己编译shc得到可以使用的可执行程序,过程如下:
make
make
install
等待系统完成即可,我这里因为权限问题,帮助文件安装出了些问题,但整体还是没有问题的。
4
我们准备一个程序,这里就使用简单的显示语句,文件名
test.sh
echo
"
this
is
a
shell"
然后
sch
-f
test.sh
完成编译操作,会发现目录下多出如下图所示的文件
5
这里是编译完成后的目录内容,可以看到
.x
的已经编译后的二进制可执行文件,而
.x.c
的是转化的C语言源文件。
6
这里显示的是经过转化过的C语言源文件,可以在同一目录下看到,内容已经经过处理,字符串都进行了编码处理。
7
我们直接执行对应的编译后的二进制程序,可以看到,效果和shell文件是一样的,但是这样源代码隐藏了起来,保密性强。
END
注意事项
shc需要自己编译,因此您需要有GCC的环境
shc
在使用了
-r
选项的时候具有通用性,很多系统之间可以直接运行,参数如下:
shc
并不是真正意义的高强度加密,因此很容易被逆向工程,所以不要依靠这个的安全性
D. 怎样实现linux下c/c++对文件加密压缩成zip文件
网上有封装好的库~好像是gzip 以前用过很好使的,可以解压 也可以压缩~
E. linux内核加密目录下的回归测试文件tcrypt.c如何使用
INTRODUCTION
The Scatterlist Crypto API takes page vectors (scatterlists) as arguments, and works directly on pages. In some cases (e.g. ECB mode ciphers), this will allow for pages to be encrypted in-place with no ing.
Scatterlist Crypto API使用页向量(scatterlists)作为参数,并且直接按页面工作。在某些情况下(例如ECB模式密码),这将允许页面不需复制而按原地加密。
One of the initial goals of this design was to readily support IPsec, so that processing can be applied to paged skb's without the need for linearization.
这个设计的初始目标之一是快捷地支持IPsec,因此处理过程能够应用于页面式缓冲区(paged skb)而无需线性化。
DETAILS
At the lowest level are algorithms, which register dynamically with the API.
处于最底层的是算法,需动态地注册到API中。
'Transforms' are user-instantiated objects, which maintain state, handle all of the implementation logic (e.g. manipulating page vectors) and provide an abstraction to the underlying algorithms. However, at the user level they are very simple.
“转换”是由用户实例化的对象,它维护状态、处理所有执行逻辑(例如操纵页面向量)并且对底层算法提供一个抽象接口。然而,在用户层它们是非常简单的。
Conceptually, the API layering looks like this:
[transform api] (user interface)
[transform ops] (per-type logic glue e.g. cipher.c, compress.c)
[algorithm api] (for registering algorithms)
从概念上讲,API分层看似这样:
[“转换”API](用户界面)
[“转换”OPS](每种类型的接口逻辑模块,例如cipher.c, compress.c)
[“算法”API](用于注册算法)
The idea is to make the user interface and algorithm registration API very simple, while hiding the core logic from both. Many good ideas from existing APIs such as Cryptoapi and Nettle have been adapted for this.
这样做是为了使得“用户界面”和“算法注册”API更加简单,而隐藏了两者之间的核心逻辑。诸如Cryptoapi和Nettle等许多现存API的良好设计都做了这方面改编。
The API currently supports five main types of transforms: AEAD (Authenticated Encryption with Associated Data), Block Ciphers, Ciphers, Compressors and Hashes.
API目前支持五种主要类型“转换”:AEAD(带关联数据的加密认证)、分组加密、加密、压缩和哈希算法。
Please note that Block Ciphers is somewhat of a misnomer. It is in fact meant to support all ciphers including stream ciphers. The difference between Block Ciphers and Ciphers is that the latter operates on exactly one block while the former can operate on an arbitrary amount of data, subject to block size requirements (i.e., non-stream ciphers can only process multiples of blocks).
请注意,分组加密多少有些用词不准。它实际上意味着支持所有加密,包含流加密。分组加密和加密之间不同之处是后者作用于一个精确的数据块而前者可以作用于任意数量的数据,但要求以数据块大小为单位(例如非流密码只能处理数据块整数倍的数据)
Support for hardware crypto devices via an asynchronous interface is under development.
通过一个异步接口支持硬件加密设备的工作正在开发中。
F. 我是大一学生,刚学c语言,请问怎么用代码实现给文件保密。简单的加密。注:我们是在linux环境下编程。
调用 zip 压缩加密码。绝对取巧但有效!
不过如果是 Linux 下面,你有很多函数库可以找。
其实加密随便啦,只要让别人不能读取出来就行了。可以说用 base64 转码一下都有加密效果。加密算法有很多的,只要别用不可逆就行了。最简单的来说,用密码异或一下就算入门加密技术了。