在Ubuntu上使用OpenSSL解密,步骤如下:
安装OpenSSL(若未安装):
sudo apt update && sudo apt install openssl 确定加密算法:
.enc文件),需知道具体模式(如-aes-256-cbc)。.pem私钥加密),需对应的私钥文件。执行解密命令:
openssl enc -d -aes-256-cbc -in encrypted_file.enc -out decrypted_file -pass pass:your_password (-pass可替换为-pass file:/path/to/keyfile指定密码文件)openssl rsautl -decrypt -inkey private_key.pem -in encrypted_file.enc -out decrypted_file (若私钥有密码,需添加-passin pass:your_password)注意事项:
根据加密方式选择对应命令,执行后解密文件会保存至指定路径。