note: I'm not looking for a workaround, I'm looking for a simple ruby โโsolution!
this question is similar to this question , but this is not the answer, its just a workaround to the shell there.
I want to create an encrypted sha512 string that is compatible with the format in debian / etc / shadow.
create the correct line with php :
$salt = 'fGn9LR75'; $hash = crypt('test', '$6$'.$salt); // hash is: // $6$fGn9LR75$YpI/vJHjEhvrYp5/eUSRinpiXdMthCxFWSEo0ktFNUaRBsA7pCWYzzmQptmnfyHno9YEJFNHYuESj3nAQmSzc1
as far as i know this is a normal, salty base64 encoded string. sha generation method specification here
ruby php base64 sha512
c33s
source share