在命令行上解密使用PHP openssl_encrypt制作的文件 [英] Decrypt File Made With PHP openssl_encrypt on Command Line

查看:201
本文介绍了在命令行上解密使用PHP openssl_encrypt制作的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要输入encyrpt的字符串:

I have a string to encyrpt:

$encryptThis = "Super Secret Text";
echo openssl_encrypt($encryptThis, 'aes-128-cbc', '1234', FALSE, 'F68A9A229A516752');

然后我得到了那个php文件,最后得到的字符串看起来像是base64字符串.

I then wget get the that php file and end up with what looks like a base64 string of characters.

当我尝试在命令行上对其进行解码时,出现读取输入文件错误".我用来尝试解密的命令是:

When I try to decode it on the command line I get "error reading input file". The command I am using to try and decrypt is:

openssl aes-128-cbc -a -iv F68A9A229A516752 -d -in encrypted.txt -out decypted.txt

encrypted.txt是我保存保存到的文件的文件名.我想念什么?

encrypted.txt is the file name that I saved the file I wget'ed to. What am I missing?

推荐答案

我最终只制作了一个使用php exec()调用的shell脚本.我永远无法获得PHP内置函数来在命令行上进行解码.

I finally ended up just making a shell script that is called using php exec(). I never could get PHP built in functions to decode on the command line.

这篇关于在命令行上解密使用PHP openssl_encrypt制作的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆