+
    THif?                     :   R t ^ RIHtHt ^ RIHtHt ^ RIHu H	t
 ^ RIHt ^ RIHt ^ RIHtHt . R%Ot ! R
 R]
P&                  ]
P(                  ]
P*                  ]
P,                  4      tRR]3R lt]! R^RRR7      t]! R^ R4      t]! R^@R4      t]
P:                  ! R]RRRR7      t]
P:                  ! R]RRRR7      t]
P:                  ! R]RRRR7      t Rt! ! R  R]
P&                  ]
P(                  ]
P*                  ]
P,                  4      t" ! R! R]
P&                  ]
PF                  ]
P,                  4      t$ ! R" R#]
P(                  ]
P*                  ]
P,                  4      t% ! R$ R	]
P&                  ]
P(                  ]
P*                  ]
P,                  4      t&R# )&zPBKDF2 based hashes)	b64decode	b64encode)hexlify	unhexlifyN)pbkdf2_hmac)
to_unicode)ab64_decodeab64_encodecta_pbkdf2_sha1dlitz_pbkdf2_sha1grub_pbkdf2_sha512c                   x   a  ] tR t^t o RtR
t]P                  t^t	Rt
Rt^tRtRtRt]R 4       tR tR tR	tV tR# )Pbkdf2DigestHandlerz1base class for various pbkdf2_{digest} algorithms   N    linearc                    \         P                  ! WP                  V R 7      w  r#p\        VP	                  R4      4      pV'       d   \        VP	                  R4      4      pV ! W#VR7      # ))handlerasciiroundssaltchecksum)uh	parse_mc3identr   encodeclshashr   r   chks   &&   9/usr/lib/python3/dist-packages/passlib/handlers/pbkdf2.pyfrom_stringPbkdf2DigestHandler.from_string2   sQ    LLyy#Fc4;;w/0cjj12C&c::    c                    \        V P                  4      P                  R 4      p\        V P                  4      P                  R 4      p\        P
                  ! V P                  V P                  W4      # r   )r	   r   decoder   r   
render_mc3r   r   selfr   r    s   &  r!   	to_stringPbkdf2DigestHandler.to_string:   sO    499%,,W5$--(//8}}TZZd@@r$   c                n    \        V P                  WP                  V P                  V P                  4      # )N)r   _digestr   r   checksum_sizer*   secrets   &&r!   _calc_checksum"Pbkdf2DigestHandler._calc_checksum?   s*    LL&))T[[$:L:L
 	
r$    r   	salt_sizer   )__name__
__module____qualname____firstlineno____doc__setting_kwdsr   HASH64_CHARSchecksum_charsdefault_salt_sizemax_salt_sizedefault_rounds
min_rounds
max_roundsrounds_costr.   classmethodr"   r+   r2   __static_attributes____classdictcell____classdict__s   @r!   r   r      sh      < 3L__N M NJJK G ; ;A

 
r$   r   i.  c                    RV ,           pVf   RV  R2p\         p\        VV3\        VVVV VVV^,          ^,           ^,          R\        V P                  4       VP                  VR7      ,          R7      4      # )z;create new Pbkdf2DigestHandler subclass for a specific hashpbkdf2_z$pbkdf2-$a$  This class implements a generic ``PBKDF2-HMAC-%(digest)s``-based password hash, and follows the :ref:`password-hash-api`.

    It supports a variable-length salt, and a variable number of rounds.

    The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

    :type salt: bytes
    :param salt:
        Optional salt bytes.
        If specified, the length must be between 0-1024 bytes.
        If not specified, a %(dsc)d byte salt will be autogenerated (this is recommended).

    :type salt_size: int
    :param salt_size:
        Optional number of bytes to use when autogenerating new salts.
        Defaults to %(dsc)d bytes, but can be any value between 0 and 1024.

    :type rounds: int
    :param rounds:
        Optional number of rounds to use.
        Defaults to %(dr)d, but must be within ``range(1,1<<32)``.

    :type relaxed: bool
    :param relaxed:
        By default, providing an invalid value for one of the other
        keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
        and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
        will be issued instead. Correctable errors include ``rounds``
        that are too small or too large, and ``salt`` strings that are too long.

        .. versionadded:: 1.6
    )digestdscdr)r8   namer   r.   rA   r/   encoded_checksum_sizer;   )r   typedictupperr?   )	hash_namedigest_sizer   r   modulerP   bases   &&&&&  r!   create_pbkdf2_hashrY   F   s     y D}9+Q'D	!%#.?Q#61"<@ )//+1G1GFSA T)	
- -r$   sha1i z$pbkdf2$)r   sha256iHq  sha512ia  ldap_pbkdf2_sha1z{PBKDF2}Tldap_pbkdf2_sha256z{PBKDF2-SHA256}z$pbkdf2-sha256$ldap_pbkdf2_sha512z{PBKDF2-SHA512}z$pbkdf2-sha512$s   -_c                   |   a  ] tR t^t o RtR tRtRt^t^t	Rt
]P                  t^tRtRt]R 4       tR tR tR	tV tR
# )r
   a  This class implements Cryptacular's PBKDF2-based crypt algorithm, and follows the :ref:`password-hash-api`.

It supports a variable-length salt, and a variable number of rounds.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

:type salt: bytes
:param salt:
    Optional salt bytes.
    If specified, it may be any length.
    If not specified, a one will be autogenerated (this is recommended).

:type salt_size: int
:param salt_size:
    Optional number of bytes to use when autogenerating new salts.
    Defaults to 16 bytes, but can be any value between 0 and 1024.

:type rounds: int
:param rounds:
    Optional number of rounds to use.
    Defaults to 60000, must be within ``range(1,1<<32)``.

:type relaxed: bool
:param relaxed:
    By default, providing an invalid value for one of the other
    keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
    and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
    will be issued instead. Correctable errors include ``rounds``
    that are too small or too large, and ``salt`` strings that are too long.

    .. versionadded:: 1.6
$p5k2$r   r   r   c                    \         P                  ! WP                  ^V R7      w  r#p\        VP	                  R4      \
        4      pV'       d    \        VP	                  R4      \
        4      pV ! W#VR7      # )   )rounds_baser   r   r   )r   r   r   r   r   CTA_ALTCHARSr   s   &&   r!   r"   cta_pbkdf2_sha1.from_string   sZ     LLyybRUVcW-|<CJJw/>C&c::r$   c                   \        V P                  \        4      P                  R 4      p\        V P                  \        4      P                  R 4      p\
        P                  ! V P                  V P                  W^R7      # )r   rd   )	r   r   re   r'   r   r   r(   r   r   r)   s   &  r!   r+   cta_pbkdf2_sha1.to_string   sU    L188A|4;;GD}}TZZdRPPr$   c                F    \        R WP                  V P                  ^4      # )rZ   r   r   r   r0   s   &&r!   r2   cta_pbkdf2_sha1._calc_checksum   s    6699dkk2FFr$   r4   Nr5   )r7   r8   r9   r:   r;   rP   r<   r   r/   r?   r@   pbkdf2_sha1rA   rB   rC   rD   rE   r"   r+   r2   rF   rG   rH   s   @r!   r
   r
      sp     D D2LEM M !//NJJK ; ;Q
G Gr$   c                      a  ] tR t^t o RtR tRtRtRt^t	Rt
]P                  t]P                  t^tRtRt]R 4       tR tR tR	 tR
tV tR# )r   a  This class implements Dwayne Litzenberger's PBKDF2-based crypt algorithm, and follows the :ref:`password-hash-api`.

It supports a variable-length salt, and a variable number of rounds.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

:type salt: str
:param salt:
    Optional salt string.
    If specified, it may be any length, but must use the characters in the regexp range ``[./0-9A-Za-z]``.
    If not specified, a 16 character salt will be autogenerated (this is recommended).

:type salt_size: int
:param salt_size:
    Optional number of bytes to use when autogenerating new salts.
    Defaults to 16 bytes, but can be any value between 0 and 1024.

:type rounds: int
:param rounds:
    Optional number of rounds to use.
    Defaults to 60000, must be within ``range(1,1<<32)``.

:type relaxed: bool
:param relaxed:
    By default, providing an invalid value for one of the other
    keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
    and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
    will be issued instead. Correctable errors include ``rounds``
    that are too small or too large, and ``salt`` strings that are too long.

    .. versionadded:: 1.6
ra   r   r   r   c                d    \         P                  ! WP                  ^RV R7      w  r#pV ! W#VR7      # )rc     )rd   rA   r   r   )r   r   r   r   s   &&   r!   r"   dlitz_pbkdf2_sha1.from_string.  s1    LL))C
c &c::r$   c                    V P                   pVR 8X  d   Rp\        P                  ! V P                  WP                  V P
                  ^R7      # rp   Nrh   )r   r   r(   r   r   r   r*   r   s   & r!   r+   dlitz_pbkdf2_sha1.to_string5  s=    S=F}}JJ		4==b
 	
r$   c                    V P                   pVR 8X  d   Rp\        P                  ! V P                  WP                  R^R7      # rs   )r   r   r(   r   r   rt   s   & r!   _get_configdlitz_pbkdf2_sha1._get_config=  s4    S=F}}TZZDbQQr$   c                    V P                  4       p\        R WV P                  ^4      p\        V4      P	                  R4      # )rZ   r   )rw   r   r   r	   r'   )r*   r1   r   results   &&  r!   r2    dlitz_pbkdf2_sha1._calc_checksumC  s:    !VV4;;C6"))'22r$   r4   Nr5   z1000000000000000000000000000000000000000000000000=)r7   r8   r9   r:   r;   rP   r<   r   _stub_checksumr?   r@   r   r=   
salt_charsrm   rA   rB   rC   rD   rE   r"   r+   rw   r2   rF   rG   rH   s   @r!   r   r      s|     D D2LE#N MJ
 !//NJJK ; ;
R3 3r$   c                   X   a  ] tR tRt o RtR tR	tRt^ t^;t	t
]R 4       tR tR tRtV tR# )
atlassian_pbkdf2_sha1iJ  a  This class implements the PBKDF2 hash used by Atlassian.

It supports a fixed-length salt, and a fixed number of rounds.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

:type salt: bytes
:param salt:
    Optional salt bytes.
    If specified, the length must be exactly 16 bytes.
    If not specified, a salt will be autogenerated (this is recommended).

:type relaxed: bool
:param relaxed:
    By default, providing an invalid value for one of the other
    keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
    and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
    will be issued instead. Correctable errors include
    ``salt`` strings that are too long.

    .. versionadded:: 1.6
z	{PKCS5S2}c                    \        VR R4      pV P                  pVP                  V4      '       g    \        P                  P                  V 4      h\        V\        V4      R P                  R 4      4      pVR,          VR,          rTV ! WER7      # )r   r   N:Nrc   N:rc   NN)r   r   )	r   r   
startswithr   excInvalidHashErrorr   lenr   )r   r   r   datar   r    s   &&    r!   r"   !atlassian_pbkdf2_sha1.from_stringk  sw    $0		u%%&&))#..c%jl+227;<ItCyc++r$   c                    V P                   V P                  ,           pV P                  \        V4      P	                  R 4      ,           # r&   )r   r   r   r   r'   )r*   r   s   & r!   r+   atlassian_pbkdf2_sha1.to_stringu  s2    yy4==(zzIdO227;;;r$   c                2    \        R WP                  R^ 4      # )rZ   i'  )r   r   r0   s   &&r!   r2   $atlassian_pbkdf2_sha1._calc_checksumy  s     6699eR@@r$   r4   N)r   )r7   r8   r9   r:   r;   rP   r<   r   r/   min_salt_sizer@   rE   r"   r+   r2   rF   rG   rH   s   @r!   r   r   J  sO     0 #DLEM %'&MM, ,<A Ar$   r   c                   |   a  ] tR tRt o RtR tRtRt^@t^@t	Rt
]P                  t^tRtRt]R 4       tR tR	 tR
tV tR# )r   i  a  This class implements Grub's pbkdf2-hmac-sha512 hash, and follows the :ref:`password-hash-api`.

It supports a variable-length salt, and a variable number of rounds.

The :meth:`~passlib.ifc.PasswordHash.using` method accepts the following optional keywords:

:type salt: bytes
:param salt:
    Optional salt bytes.
    If specified, the length must be between 0-1024 bytes.
    If not specified, a 64 byte salt will be autogenerated (this is recommended).

:type salt_size: int
:param salt_size:
    Optional number of bytes to use when autogenerating new salts.
    Defaults to 64 bytes, but can be any value between 0 and 1024.

:type rounds: int
:param rounds:
    Optional number of rounds to use.
    Defaults to 19000, but must be within ``range(1,1<<32)``.

:type relaxed: bool
:param relaxed:
    By default, providing an invalid value for one of the other
    keywords will result in a :exc:`ValueError`. If ``relaxed=True``,
    and the error can be corrected, a :exc:`~passlib.exc.PasslibHashWarning`
    will be issued instead. Correctable errors include ``rounds``
    that are too small or too large, and ``salt`` strings that are too long.

    .. versionadded:: 1.6
zgrub.pbkdf2.sha512.r   r   r   c                    \         P                  ! WP                  R V R7      w  r#p\        VP	                  R4      4      pV'       d   \        VP	                  R4      4      pV ! W#VR7      # ).)sepr   r   r   )r   r   r   r   r   r   s   &&   r!   r"   grub_pbkdf2_sha512.from_string  sS    LLyyc3OcW-.CJJw/0C&c::r$   c                &   \        V P                  4      P                  R 4      P                  4       p\        V P                  4      P                  R 4      P                  4       p\
        P                  ! V P                  V P                  WRR7      # )r   r   )r   )	r   r   r'   rT   r   r   r(   r   r   r)   s   &  r!   r+   grub_pbkdf2_sha512.to_string  sc    tyy!((1779dmm$++G4::<}}TZZdSIIr$   c                F    \        R WP                  V P                  ^@4      # )r\   rk   r0   s   &&r!   r2   !grub_pbkdf2_sha512._calc_checksum  s     8VYYRHHr$   r4   Nr5   )r7   r8   r9   r:   r;   rP   r<   r   r/   r?   r@   pbkdf2_sha512rA   rB   rC   rD   rE   r"   r+   r2   rF   rG   rH   s   @r!   r   r     sl     B  D2L!EM M"11NJJK; ;J
I Ir$   )rm   pbkdf2_sha256r   r
   r   r   )'r;   base64r   r   binasciir   r   passlib.utils.handlersutilshandlersr   passlib.crypto.digestr   passlib.utilsr   passlib.utils.binaryr   r	   __all__	HasRounds
HasRawSaltHasRawChecksumGenericHandlerr   r7   rY   rm   r   r   PrefixWrapperr]   r^   r_   re   r
   HasSaltr   r   r   r4   r$   r!   <module>r      s    ' ' # # - $ 9.
LL"--!2!2B4E4E.
d $)X5v !V:F"8R7"8R7##Z4  %%
  %%
  OGLL"--!2!2B4E4EOGdY3bjj"2C2C Y3x3ABMM2+<+<b>O>O 3AlFILL"--!2!2B4E4EFIr$   