0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Windows/Linux] コマンドラインでBASE64を使う

Posted at

BASE64にEncodeすることで、バイナリを可読テキストで表現できる。

Windows

コマンド

certutil -encode src.txt b64.txt
certutil -decode b64.txt b64_dec.txt

サンプル

 type src.txt
 テスト

 certutil -encode src.txt b64.txt

 type b64.txt
 -----BEGIN CERTIFICATE-----
 g2WDWINnIA0K
 -----END CERTIFICATE-----

 certutil -decode b64.txt b64_dec.txt

 type b64_dec.txt
 テスト

Linux

コマンド

cat src.txt | base64 > b64.txt
cat b64.txt | base64 -d > b64_dec.txt

サンプル

echo "test" | base64
dGVzdA==

echo "dGVzdA==" | base64 -b
test
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?