曲径通幽论坛

 找回密码
 立即注册
搜索
查看: 3488|回复: 0
打印 上一主题 下一主题

crypt -- 加密文件

[复制链接]

4918

主题

5880

帖子

3万

积分

GROAD

曲径通幽,安觅芳踪。

Rank: 6Rank: 6

积分
34397
跳转到指定楼层
楼主
发表于 2012-4-13 11:28:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
crypt 命令加密基于 DES 加密算法。一般情况下可能没有安装在 Linux 发行版上,在 Ubuntu 上可以安装 mcrypt 软件包而获得该命令:
# apt-get install mcrypt

一般使用方法如下:
# crypt <secret.txt> secreted.txt
Unix crypt(1) emulation program using mcrypt(1).

Use crypt -h for more help.
Enter the passphrase (maximum of 512 characters)
Please use a combination of upper and lower case letters and numbers.
Enter passphrase:
Enter passphrase:

Stdin was encrypted.
注意,要加密的文件要被 < > 所括。上面的 Enter passphrase: 是要求输入加密密钥。我们也可以在命令行上直接指定出密码,而不用进入到交互式:
# crypt www.groad.net < secret.txt > secreted.txt
上面的 www.groad.net 是加密密钥。

如果要解密,那么使用 -d 选项:
# crypt www.groad.net -d < secreted.txt > secret.txt
Unix crypt(1) emulation program using mcrypt(1).

Use crypt -h for more help.
Warning: It is insecure to specify keywords in the command line
Stdin was encrypted.
上面,www.groad.net 是之前加密时输入的加密密钥。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )

GMT+8, 2025-6-18 21:54 , Processed in 0.062383 second(s), 22 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表