xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Linux shell command base64 All In One

Linux shell command base64 All In One

email address encryption / 邮箱地址加密

应用场景

防止爬虫爬取邮箱地址发送垃圾邮件

base64 encode & decode

$ base64 --version
base64 (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
许可证 GPLv3+:GNU 通用公共许可证第 3 版或更新版本<https://gnu.org/licenses/gpl.html>。
本软件是自由软件:您可以自由修改和重新发布它。
在法律范围内没有其他保证。
由Simon Josefsson 编写。
$ base64 --help
用法:base64 [选项]... [文件]
使用 Base64 编码/解码文件或标准输入输出。

如果没有指定文件,或者文件为"-",则从标准输入读取。

必选参数对长短选项同时适用。
  -d, --decode		解码数据
  -i, --ignore-garbag	解码时忽略非字母字符
  -w, --wrap=字符数	在指定的字符数后自动换行(默认为76),0 为禁用自动换行

      --help		显示此帮助信息并退出
      --version		显示版本信息并退出

数据以 RFC 4648 规定的 base64 字母格式进行编码。
解码时,输入数据(编码流)可能包含一些非有效 base64 字符以及换行符。
可以尝试用 --ignore-garbage 选项来绕过编码流中的无效字符。

GNU coreutils 在线帮助:<https://www.gnu.org/software/coreutils/>
请向 <http://translationproject.org/team/zh_CN.html> 报告任何翻译错误
完整文档 <https://www.gnu.org/software/coreutils/base64>
或者在本地使用:info '(coreutils) base64 invocation'

https://www.gnu.org/software/coreutils/base64

https://www.gnu.org/software/coreutils/

http://translationproject.org/team/zh_CN.html

$ man base64

BASE64(1)                                          User Commands                                          BASE64(1)

NAME
       base64 - base64 encode/decode data and print to standard output

SYNOPSIS
       base64 [OPTION]... [FILE]

DESCRIPTION
       Base64 encode or decode FILE, or standard input, to standard output.

       With no FILE, or when FILE is -, read standard input.

       Mandatory arguments to long options are mandatory for short options too.

       -d, --decode
              decode data

       -i, --ignore-garbage
              when decoding, ignore non-alphabet characters

       -w, --wrap=COLS
              wrap encoded lines after COLS character (default 76).  Use 0 to disable line wrapping

       --help display this help and exit

       --version
              output version information and exit

       The data are encoded as described for the base64 alphabet in RFC 4648.  When decoding, the input may contain
       newlines in addition to the bytes of the formal base64 alphabet.  Use --ignore-garbage to attempt to recover
       from any other non-alphabet bytes in the encoded stream.

AUTHOR
       Written by Simon Josefsson.

REPORTING BUGS
       GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
       Report any translation bugs to <https://translationproject.org/team/>

COPYRIGHT
       Copyright   ©   2020   Free  Software  Foundation,  Inc.   License  GPLv3+:  GNU  GPL  version  3  or  later
       <https://gnu.org/licenses/gpl.html>.
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the extent per‐
       mitted by law.

SEE ALSO
       Full documentation <https://www.gnu.org/software/coreutils/base64>
       or available locally via: info '(coreutils) base64 invocation'

GNU coreutils 8.32                                 September 2020                                         BASE64(1)
 Manual page base64(1) line 1/51 (END) (press h for help or q to quit)


demos

# encode / 加密
$ echo "xgqfrms@xgqfrms.xyz" | base64
eGdxZnJtc0B4Z3Fmcm1zLnh5ego=

# decode / 解密
$ echo "eGdxZnJtc0B4Z3Fmcm1zLnh5ego=" | base64 --decode

# alias
$ echo "eGdxZnJtc0B4Z3Fmcm1zLnh5ego=" | base64 -d

image

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs

https://contact.cyrusyip.org/



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2023-05-30 22:16  xgqfrms  阅读(74)  评论(0编辑  收藏  举报