LoginSignup
0
2

More than 5 years have passed since last update.

ハッシュ化パスワードを生成する

Posted at

Pythonを使ってUnixのパスワードファイル用のハッシュ化パスワードをコマンドラインから生成する方法.

Python3.3以降でしか動作しません.

ハッシュアルゴリズムはSHA512とする. PythonのcryptモジュールはOSのcrypt(3)に依存するようなので, macOSでは動作しなかった.

$ python3.6 -c "import crypt; print(crypt.crypt(input('password: '), crypt.METHOD_SHA512))"

参考 https://docs.python.org/3/library/crypt.html

0
2
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
2