可以的。Linux 下的 OpenSSL 完全可以用来加密文件和通信,而且非常常用。
下面按常见用途给你说明一下:
openssl enc -aes-256-cbc -salt -in file.txt -out file.txt.enc
file.txt.enc 是加密后的文件openssl enc -d -aes-256-cbc -in file.txt.enc -out file.txt
✅ 常用算法:
aes-256-cbc(推荐)aes-128-cbcdes(不推荐,已不安全)echo "hello" | openssl base64
openssl genrsa -out private.key 2048
openssl rsa -in private.key -pubout -out public.key
openssl pkeyutl -encrypt -in file.txt -pubin -inkey public.key -out file.enc
openssl pkeyutl -decrypt -in file.enc -inkey private.key -out file.txt
openssl s_client)如果你愿意,可以告诉我:
我可以给你更具体的命令示例。