OpenSSL“错误读取输入文件";和“不良魔术数"

编程入门 行业动态 更新时间:2024-10-26 09:21:33
本文介绍了OpenSSL“错误读取输入文件";和“不良魔术数"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试加密一个简单的字符串"Hello world".使用OpenSSL命令行工具.我已经尝试过同时使用base64和binary进行加密.但是我遇到了一些无用的错误.

I'm trying to encrypt a simple string "Hello world." with the OpenSSL command line tool. I've tried both encrypting using both base64 and binary. But I'm getting some unhelpful errors.

$ "Hello world." > plain.txt $ openssl enc -aes-128-ecb -e -base64 -in plain.txt > enc.txt enter aes-128-ecb encryption password: Verifying - enter aes-128-ecb encryption password: $ cat enc.txt U2FsdGVkX18ZoAY34fL2aMO0Bu5AJnewemhfiBmSL1IJujqOtpJm7V0C+Tt83egJ $ openssl enc -aes-128-ecb -d -base64 -in enc.txt > out.txt enter aes-128-ecb decryption password: error reading input file

然后我尝试使用二进制文件

Then I try binary

$ "Hello world." > plain.txt $ openssl enc -aes-128-ecb -e -in plain.txt > enc.bin enter aes-128-ecb encryption password: Verifying - enter aes-128-ecb encryption password: $ openssl enc -aes-128-ecb -d -in enc.bin > out.txt enter aes-128-ecb decryption password: bad magic number

推荐答案

标记,我看不到您的命令有任何问题.它们在我的系统上都运行良好.所以问题一定在其他地方.

Mark, I don't see anything wrong with your commands. They all worked fine on my system. So the problem must be somewhere else.

我建议尝试安装不同版本的OpenSSL或其他系统.

I'd recommend trying a different installation/version of OpenSSL, or a different system.

更多推荐

OpenSSL“错误读取输入文件";和“不良魔术数"

本文发布于:2023-11-12 07:13:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580852.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:魔术   不良   错误   文件   OpenSSL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!