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 1 year has passed since last update.

opensslで平文パスワードを暗号化でき、複合化もできます。

Posted at

シェルスクリプトなんかに結構平文パスワードをそのまま書いているケースがある。

以下の方法で平文パスワードを暗号化できる。

使用するときは複合化すればいい。

暗号化手順

[root@redhat69 ~]# echo "root" | openssl enc -e -aes-256-cbc -base64 -k "foo"
U2FsdGVkX18UAwEWpq7TA/sh00Am7NtaoFYZ0yNFWAY=

複合化手順

[root@redhat69 ~]# echo "U2FsdGVkX1+TC1qT9/DNw+xEURIyo4ab3v0oYHbKyfs=" | openssl enc -d -aes-256-cbc -base64 -k "foo"
root

以下のサイトの内容をそのまま

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?