Skip to main content
edited title; edited tags
Link
Vlastimil Burián
  • 31.3k
  • 66
  • 210
  • 358

shadow/etc/shadow file and password storing algorithm in linuxLinux

deleted 2 characters in body
Source Link
PersianGulf
  • 11.3k
  • 11
  • 56
  • 83

I don't know what's algorithm of storing password in /etc/shadow in Linux.
I tested via the following script via python:

import hashlib message = b"123" md5_hash = hashlib.md5(message).hexdigest() sha1_hash = hashlib.sha1(message).hexdigest() sha256_hash = hashlib.sha256(message).hexdigest() sha384_hash = hashlib.sha384(message).hexdigest() sha512_hash = hashlib.sha512(message).hexdigest() print(f"MD5: {md5_hash}") print(f"SHA-1: {sha1_hash}") print(f"SHA-256: {sha256_hash}") print(f"SHA-384: {sha384_hash}") print(f"SHA-512: {sha512_hash}") 

But I did't see my password.My password is 123.

  1. Does shadow store as HASH? if yes I should discard getting password.
  2. If password doesn't store as hash, How can I get themit?

I don't know what's algorithm of storing password in /etc/shadow in Linux.
I tested via the following script via python:

import hashlib message = b"123" md5_hash = hashlib.md5(message).hexdigest() sha1_hash = hashlib.sha1(message).hexdigest() sha256_hash = hashlib.sha256(message).hexdigest() sha384_hash = hashlib.sha384(message).hexdigest() sha512_hash = hashlib.sha512(message).hexdigest() print(f"MD5: {md5_hash}") print(f"SHA-1: {sha1_hash}") print(f"SHA-256: {sha256_hash}") print(f"SHA-384: {sha384_hash}") print(f"SHA-512: {sha512_hash}") 

But I did't see my password.My password is 123.

  1. Does shadow store as HASH? if yes I should discard getting password.
  2. If password doesn't store as hash, How can I get them?

I don't know what's algorithm of storing password in /etc/shadow in Linux.
I tested via the following script via python:

import hashlib message = b"123" md5_hash = hashlib.md5(message).hexdigest() sha1_hash = hashlib.sha1(message).hexdigest() sha256_hash = hashlib.sha256(message).hexdigest() sha384_hash = hashlib.sha384(message).hexdigest() sha512_hash = hashlib.sha512(message).hexdigest() print(f"MD5: {md5_hash}") print(f"SHA-1: {sha1_hash}") print(f"SHA-256: {sha256_hash}") print(f"SHA-384: {sha384_hash}") print(f"SHA-512: {sha512_hash}") 

But I did't see my password.My password is 123.

  1. Does shadow store as HASH? if yes I should discard getting password.
  2. If password doesn't store as hash, How can I get it?
Source Link
PersianGulf
  • 11.3k
  • 11
  • 56
  • 83

shadow file and algorithm in linux

I don't know what's algorithm of storing password in /etc/shadow in Linux.
I tested via the following script via python:

import hashlib message = b"123" md5_hash = hashlib.md5(message).hexdigest() sha1_hash = hashlib.sha1(message).hexdigest() sha256_hash = hashlib.sha256(message).hexdigest() sha384_hash = hashlib.sha384(message).hexdigest() sha512_hash = hashlib.sha512(message).hexdigest() print(f"MD5: {md5_hash}") print(f"SHA-1: {sha1_hash}") print(f"SHA-256: {sha256_hash}") print(f"SHA-384: {sha384_hash}") print(f"SHA-512: {sha512_hash}") 

But I did't see my password.My password is 123.

  1. Does shadow store as HASH? if yes I should discard getting password.
  2. If password doesn't store as hash, How can I get them?