windows_10.py 466 B

1234567891011
  1. def raw(cls, secret, user):
  2. """encode password using mscash v1 algorithm
  3. :arg secret: secret as unicode or utf-8 encoded bytes
  4. :arg user: username to use as salt
  5. :returns: returns string of raw bytes
  6. """
  7. secret = to_unicode(secret, "utf-8", param="secret").encode("utf-16-le")
  8. user = to_unicode(user, "utf-8", param="user").lower().encode("utf-16-le")
  9. return md4(md4(secret).digest() + user).digest()