Ejemplo n.º 1
0
 def _calc_checksum(self, secret):
     # NOTE: no reference for how sun_md5_crypt handles unicode
     if isinstance(secret, unicode):
         secret = secret.encode("utf-8")
     config = str_to_bascii(self.to_string(withchk=False))
     return raw_sun_md5_crypt(secret, self.rounds, config).decode("ascii")
Ejemplo n.º 2
0
 def _calc_checksum(self, secret):
     if isinstance(secret, unicode):
         secret = secret.encode("utf-8")
     salt = str_to_bascii(self.to_string(withchk=False))
     result = pbkdf2(secret, salt, self.rounds, 24, "hmac-sha1")
     return ab64_encode(result).decode("ascii")
Ejemplo n.º 3
0
 def _calc_checksum(self, secret):
     # NOTE: no reference for how sun_md5_crypt handles unicode
     if isinstance(secret, unicode):
         secret = secret.encode("utf-8")
     config = str_to_bascii(self.to_string(withchk=False))
     return raw_sun_md5_crypt(secret, self.rounds, config).decode("ascii")
Ejemplo n.º 4
0
 def _calc_checksum(self, secret):
     if isinstance(secret, unicode):
         secret = secret.encode("utf-8")
     salt = str_to_bascii(self.to_string(withchk=False))
     result = pbkdf2(secret, salt, self.rounds, 24, "hmac-sha1")
     return ab64_encode(result).decode("ascii")