use*_*849 8 command-line openssl
我有一条消息,我知道用于加密它的密码和密码,但我不知道如何要求 openssl 对其进行解密。
我在ciphers命令的输出中看到了密码,手册页列出了 的enc命令Encoding with Ciphers,但我找不到相反的方法,对消息进行解码。
我想你正在寻找这样的东西:
openssl yourcipher -d < yourfile
Run Code Online (Sandbox Code Playgroud)
例如,如果文件使用des3密码加密,则文件为/path/to/file.des3:
openssl des3 -d < /path/to/file.des3
Run Code Online (Sandbox Code Playgroud)
它会询问您密码。
如果文件是 base64 编码的,那么您应该能够像这样解码和解密:
openssl enc -base64 -d < /path/to/file | openssl yourcipher -d
Run Code Online (Sandbox Code Playgroud)