I have several (old) Linux systems that have users and passwords saved on a local database. The process is simple. Using python, you are asked to enter a password, the entered plain text passwords are processed using python's crypt module and the hashed password is then saved to the database.
For instance,
# Password.py (not editable)
Debug = 1
import getpass
plain_pass = getpass.getpass()
# e.g. plain_pass="pass"
import crypt
crypt_pass = crypt.crypt( plain_pass, r'$1$xx')
# The salt r'$1$xx' can not be changed
if Debug:
print (crypt_pass) # Result: $1$xx$Ik.nuioJufb1VPeTbLQ.y/
(ignoring security issues for now) I want to provide a simple text file where username and hashed passwords are stored:
Sample Password.txt file
user1 $1$xx$Ik.nuioJufb1VPeTbLQ.y/
user2 $1$xx$x2gmo6Eob2udHl0tNU2Zw0 (password is 123)
A windows server will host the files for all the linux machines, it also provides a user interface where users can modify their passwords or new users can be created.
Using windows (VB or any other win application), how to generate the same hashes as with python's crypt.crypt()?
pass ---> $1$xx$Ik.nuioJufb1VPeTbLQ.y/
123 ---> $1$xx$x2gmo6Eob2udHl0tNU2Zw0
hello ---> $1$xx$zrPVW4APkg66JghmAwqmA.
üfñ2 ---> $1$xx$CPthCTb1yiYoLfl3VmrJl/