コード例 #1
0
 def to_string(self):
     hash = u("_%s%s%s") % (
         h64.encode_int24(self.rounds).decode("ascii"),
         self.salt,
         self.checksum,
     )
     return uascii_to_str(hash)
コード例 #2
0
 def to_string(self):
     if self.rounds == 5000 and self.implicit_rounds:
         hash = u"%s%s$%s" % (self.ident, self.salt, self.checksum or u'')
     else:
         hash = u"%srounds=%d$%s$%s" % (self.ident, self.rounds, self.salt,
                                        self.checksum or u'')
     return uascii_to_str(hash)
コード例 #3
0
ファイル: phpass.py プロジェクト: cutso/passlib
 def to_string(self):
     hash = u("%s%s%s%s") % (
         self.ident,
         h64.encode_int6(self.rounds).decode("ascii"),
         self.salt,
         self.checksum or u(""),
     )
     return uascii_to_str(hash)
コード例 #4
0
 def to_string(self):
     hash = u("%s%s%s%s") % (
         self.ident,
         h64.encode_int6(self.rounds).decode("ascii"),
         self.salt,
         self.checksum or u(""),
     )
     return uascii_to_str(hash)
コード例 #5
0
ファイル: sha2_crypt.py プロジェクト: cutso/passlib
 def to_string(self):
     if self.rounds == 5000 and self.implicit_rounds:
         hash = u("%s%s$%s") % (self.ident, self.salt,
                                self.checksum or u(''))
     else:
         hash = u("%srounds=%d$%s$%s") % (self.ident, self.rounds,
                                          self.salt, self.checksum or u(''))
     return uascii_to_str(hash)
コード例 #6
0
 def to_string(self):
     hash = self._template % (
         self.ident.strip(_UDOLLAR),
         self.rounds,
         self.salt,
         self.checksum,
     )
     return uascii_to_str(hash)
コード例 #7
0
ファイル: bcrypt.py プロジェクト: sweetlikepete/gaext
 def _get_config(self, ident=None):
     "internal helper to prepare config string for backends"
     if ident is None:
         ident = self.ident
     if ident == IDENT_2Y:
         ident = IDENT_2A
     else:
         assert ident != IDENT_2X
     config = u("%s%02d$%s") % (ident, self.rounds, self.salt)
     return uascii_to_str(config)
コード例 #8
0
 def _get_config(self, ident=None):
     "internal helper to prepare config string for backends"
     if ident is None:
         ident = self.ident
     if ident == IDENT_2Y:
         ident = IDENT_2A
     else:
         assert ident != IDENT_2X
     config = u("%s%02d$%s") % (ident, self.rounds, self.salt)
     return uascii_to_str(config)
コード例 #9
0
ファイル: sun_md5_crypt.py プロジェクト: dragoncsc/HDsite
 def to_string(self, _withchk=True):
     ss = u('') if self.bare_salt else u('$')
     rounds = self.rounds
     if rounds > 0:
         hash = u("$md5,rounds=%d$%s%s") % (rounds, self.salt, ss)
     else:
         hash = u("$md5$%s%s") % (self.salt, ss)
     if _withchk:
         chk = self.checksum
         hash = u("%s$%s") % (hash, chk)
     return uascii_to_str(hash)
コード例 #10
0
ファイル: sun_md5_crypt.py プロジェクト: Kiln707/Passlib2
 def to_string(self, _withchk=True):
     ss = u'' if self.bare_salt else u'$'
     rounds = self.rounds
     if rounds > 0:
         hash = u"$md5,rounds=%d$%s%s" % (rounds, self.salt, ss)
     else:
         hash = u"$md5$%s%s" % (self.salt, ss)
     if _withchk:
         chk = self.checksum
         hash = u"%s$%s" % (hash, chk)
     return uascii_to_str(hash)
コード例 #11
0
 def to_string(self, withchk=True):
     ss = u('') if self.bare_salt else u('$')
     rounds = self.rounds
     if rounds > 0:
         hash = u("$md5,rounds=%d$%s%s") % (rounds, self.salt, ss)
     else:
         hash = u("$md5$%s%s") % (self.salt, ss)
     if withchk:
         chk = self.checksum
         if chk:
             hash = u("%s$%s") % (hash, chk)
     return uascii_to_str(hash)
コード例 #12
0
ファイル: bcrypt.py プロジェクト: thebaron/passlib
 def _get_config(self, ident=None):
     """internal helper to prepare config string for backends"""
     if ident is None:
         ident = self.ident
     if ident == IDENT_2Y:
         # none of passlib's backends suffered from crypt_blowfish's
         # buggy "2a" hash, which means we can safely implement
         # crypt_blowfish's "2y" hash by passing "2a" to the backends.
         ident = IDENT_2A
     else:
         # no backends currently support 2x, but that should have
         # been caught earlier in from_string()
         assert ident != IDENT_2X
     config = u("%s%02d$%s") % (ident, self.rounds, self.salt)
     return uascii_to_str(config)
コード例 #13
0
ファイル: bcrypt.py プロジェクト: cutso/passlib
 def _get_config(self, ident=None):
     """internal helper to prepare config string for backends"""
     if ident is None:
         ident = self.ident
     if ident == IDENT_2Y:
         # none of passlib's backends suffered from crypt_blowfish's
         # buggy "2a" hash, which means we can safely implement
         # crypt_blowfish's "2y" hash by passing "2a" to the backends.
         ident = IDENT_2A
     else:
         # no backends currently support 2x, but that should have
         # been caught earlier in from_string()
         assert ident != IDENT_2X
     config = u("%s%02d$%s") % (ident, self.rounds, self.salt)
     return uascii_to_str(config)
コード例 #14
0
ファイル: argon2.py プロジェクト: Sriramg89/Restaurant
    def to_string(self):
        version = self.version
        if version == 0x10:
            vstr = ""
        else:
            vstr = "v=%d$" % version

        data = self.data
        if data:
            kdstr = ",data=" + bascii_to_str(b64s_encode(self.data))
        else:
            kdstr = ""

        # NOTE: 'keyid' param currently not supported
        return "$argon2%s$%sm=%d,t=%d,p=%d%s$%s$%s" % (
            uascii_to_str(self.type),
            vstr,
            self.memory_cost,
            self.rounds,
            self.parallelism,
            kdstr,
            bascii_to_str(b64s_encode(self.salt)),
            bascii_to_str(b64s_encode(self.checksum)),
        )
コード例 #15
0
 def to_string(self):
     assert self.checksum is not None
     return uascii_to_str(self._hash_prefix +
                          base64.b64encode(self.checksum))
コード例 #16
0
ファイル: bcrypt.py プロジェクト: dragoncsc/HDsite
 def to_string(self):
     hash = self._template % (self.ident.strip(_UDOLLAR),
                              self.rounds, self.salt, self.checksum)
     return uascii_to_str(hash)
コード例 #17
0
 def to_string(self):
     data = self.checksum + self.salt
     hash = self.ident + b64encode(data).decode("ascii")
     return uascii_to_str(hash)
コード例 #18
0
ファイル: bcrypt.py プロジェクト: docovarr2020/DIYnow
 def _get_config(self, ident):
     """internal helper to prepare config string for backends"""
     config = u("%s%02d$%s") % (ident, self.rounds, self.salt)
     return uascii_to_str(config)
コード例 #19
0
ファイル: cisco.py プロジェクト: AFCP/forumhorizonchine
 def to_string(self):
     return "%02d%s" % (self.salt, uascii_to_str(self.checksum))
コード例 #20
0
ファイル: oracle.py プロジェクト: Glottotopia/aagd
 def to_string(self):
     chk = (self.checksum or self._stub_checksum)
     hash = u("S:%s%s") % (chk.upper(), self.salt.upper())
     return uascii_to_str(hash)
コード例 #21
0
ファイル: bcrypt.py プロジェクト: cutso/passlib
 def to_string(self):
     hash = u("%s%s,%d$%s") % (self.prefix, self.ident.strip(_UDOLLAR),
                               self.rounds, self.salt)
     if self.checksum:
         hash = u("%s$%s") % (hash, self.checksum)
     return uascii_to_str(hash)
コード例 #22
0
ファイル: bcrypt.py プロジェクト: cutso/passlib
 def to_string(self):
     hash = u("%s%02d$%s%s") % (self.ident, self.rounds, self.salt,
                                self.checksum or u(''))
     return uascii_to_str(hash)
コード例 #23
0
ファイル: pbkdf2.py プロジェクト: Aravs7/ubtz2
 def to_string(self):
     data = self.salt + (self.checksum or self._stub_checksum)
     hash = self.ident + b64encode(data).decode("ascii")
     return uascii_to_str(hash)
コード例 #24
0
 def to_string(self):
     bhash = super(django_bcrypt_sha256, self).to_string()
     return uascii_to_str(self.django_prefix) + bhash
コード例 #25
0
 def to_string(self):
     hash = u("@salt%s%s") % (self.salt, self.checksum or self._stub_checksum)
     return uascii_to_str(hash)
コード例 #26
0
ファイル: des_crypt.py プロジェクト: cutso/passlib
 def to_string(self):
     hash = u("_%s%s%s") % (h64.encode_int24(self.rounds).decode("ascii"), self.salt, self.checksum or u(""))
     return uascii_to_str(hash)
コード例 #27
0
ファイル: django.py プロジェクト: dragoncsc/HDsite
 def to_string(self):
     bhash = super(django_bcrypt_sha256, self).to_string()
     return uascii_to_str(self.django_prefix) + bhash
コード例 #28
0
ファイル: bcrypt.py プロジェクト: docovarr2020/DIYnow
 def to_string(self):
     hash = u("%s%02d$%s%s") % (self.ident, self.rounds, self.salt,
                                self.checksum)
     return uascii_to_str(hash)
コード例 #29
0
 def to_string(self):
     chk = self.checksum
     hash = u("S:%s%s") % (chk.upper(), self.salt.upper())
     return uascii_to_str(hash)
コード例 #30
0
 def to_string(self):
     hash = u("%s%s") % (self.salt, self.checksum)
     return uascii_to_str(hash)
コード例 #31
0
ファイル: bcrypt.py プロジェクト: thebaron/passlib
 def to_string(self):
     hash = u("%s%s,%d$%s") % (self.prefix, self.ident.strip(_UDOLLAR),
                               self.rounds, self.salt)
     if self.checksum:
         hash = u("%s$%s") % (hash, self.checksum)
     return uascii_to_str(hash)
コード例 #32
0
 def to_string(self):
     return "%02d%s" % (self.salt, uascii_to_str(self.checksum))
コード例 #33
0
ファイル: bcrypt.py プロジェクト: dragoncsc/HDsite
 def _get_config(self, ident):
     """internal helper to prepare config string for backends"""
     config = u("%s%02d$%s") % (ident, self.rounds, self.salt)
     return uascii_to_str(config)
コード例 #34
0
ファイル: des_crypt.py プロジェクト: cutso/passlib
 def to_string(self):
     hash = u("%s%s") % (self.salt, self.checksum or u(""))
     return uascii_to_str(hash)
コード例 #35
0
ファイル: legacy_passwords.py プロジェクト: pypa/pypi-legacy
 def to_string(self):
     assert self.checksum is not None
     return uascii_to_str(self._hash_prefix + base64.b64encode(self.checksum))