base64编解码
来源:互联网 发布:中信淘宝信用卡权益 编辑:程序博客网 时间:2024/06/15 21:42
openssl命令
基本命令格式:
- BASE64编码:
– openssl base64 [-e] -in hello.txt ——这里的-e是缺省值,所以可以省略。
– openssl base64 -in hello.txt > hello.txt.base64
– openssl base64 -e -in hello.txt -out hello.base64.en - BASE64解码:
– openssl base64 -d -in hello.txt.base64
– openssl base64 -d -in hello.txt.base64 > hello.txt.base64.de
– openssl base64 -d -in hello.base64.en -out hello.base64.de
示例一
$ echo -n Hello, world! > hello.txt$ cat hello.txt Hello, world!$ $ $ openssl base64 -in hello.txtSGVsbG8sIHdvcmxkIQ==$ openssl base64 -in hello.txt > hello.txt.base64 $ cat hello.txt.base64SGVsbG8sIHdvcmxkIQ==$ openssl base64 -d -in hello.txt.base64 Hello, world! $ openssl base64 -d -in hello.txt.base64 > hello.txt.base64.de $ cat hello.txt.base64.de$ diff hello.txt hello.txt.base64.de $
示例二
$ cat hello.txt Hello, world!$ openssl base64 -e -in hello.txt -out hello.base64.en$ cat hello.base64.en SGVsbG8sIHdvcmxkIQo=$ openssl base64 -d -in hello.base64.en -out hello.base64.de$ diff hello.txt hello.base64.de $ cat hello.base64.de Hello, world!$
在线工具
BASE64在线编解码工具:http://www1.tc711.com/tool/BASE64.htm
Python
>>> import base64>>> s = "hello, world!">>> enc = base64.b64encode(s)>>> enc'aGVsbG8sIHdvcmxkIQ=='>>> t = base64.b64decode(enc)>>> t'hello, world!'>>>
阅读全文
0 0
- VB Base64编解码
- Base64编解码原理
- BASE64编解码
- openssl base64 编、解码
- base64编解码
- Java:Base64编解码
- Base64编解码
- Base64编解码(C)
- Base64编解码(JS)
- base64编解码
- android base64编解码
- BASE64编解码
- BASE64编解码
- base64编解码
- base64编解码
- Base64编解码
- base64编解码
- BASE64编解码
- servlet中根路径和相对路径
- LeetCode: Longest Substring Without Repeating Characters
- POJ1984 Dirt Ratio(详细解析+数据)_并查集+离线操作
- C++ bitset 类的使用与简介
- 设置一个长宽一样的img的css代码
- base64编解码
- 以太网交换机工作原理
- IO的部分方法(2)
- iOS多线程开发之NSOperation
- find()与children(),parent()与parents()理解与运用
- 20170804阿里面试题
- 堆排序
- Lintcode 丢失的第一个正整数
- 2017第三次多校联合hdu6058