� c��jI� ���dZddlZ ddlZddlZddlZ ddl Z ddl m Z ddlmZe j"ed� �e j&e j(zd zZe �ZGd �d ed d ��Zd%dd�d�Zd%d�ZgZdd�d�Zedddd�edddd�dD]Zeddezddee�zd��s�neddd d!�ed"dd#d$�[[y#e$r ej dk(red��ed��wxYw)&zEWrapper to the POSIX crypt library call and associated functionality.�N�win32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)� SystemRandom)� namedtuple)�� )�removez./c��eZdZdZd�Zy)�_MethodziClass representing a salt method per the Modular Crypt Format or the legacy 2-character crypt method.c�8�dj|j�S)Nz)�format�name)�selfs �/usr/lib64/python3.12/crypt.py�__repr__z_Method.__repr__ s��"�)�)�$�)�)�4�4�N)�__name__� __module__� __qualname__�__doc__r�rrr r s ��(�5rr z name ident salt_chars total_size��roundsc��|� td}|�2t|t�s"t|jj �d���|j sd}nd|j �d�}|j rn|j ddk(r\|�d}nMtj|dz �}|d|zk7r td��d |cxkrd kstd ��td ��||d �d�z }nL|j d vr.|�zmksalt..Fs����M�4L�D����J�'�4L�s�#%) �methods� isinstance�int� TypeError� __class__r�ident� bit_length� ValueError�join�range� salt_chars)�methodr�s� log_roundss r�mksaltr:$s��� �~����� ��*�V�S�"9��6�+�+�4�4�5�64�5�6� 6� �<�<� ���� � �~�Q� �� �|�|�� � �Q��3�.� �>��J�����q��1�J���j��(� �!>�?�?�� �(�b�(� �!H�I�I�)� �!H�I�I� � �3��q� !�!�� ���� #� � ��6�0�[�0� �!N�O�O�1� �!N�O�O� �7�6�(�!�$� $�A� � ��F�8�#G�H�I�I�����M�E�&�:K�:K�4L�M� M�M�A� �Hrc�h�|�t|t�r t|�}tj||�S)aRReturn a string representing the one-way hash of a password, with a salt prepended. If ``salt`` is not specified or is ``None``, the strongest available method will be selected and a salt generated. Otherwise, ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as returned by ``crypt.mksalt()``. )r-r r:�_crypt�crypt)�word�salts rr=r=Js,�� �|�z�$��0��d�|�� �<�<��d� #�#rc�x�t|g|���}|t�d|z<t||��}d} td|�}|r.t|�|jk(rtj|�yy#t$rF}|j t j t jt jhvrYd}~y�d}~wwxYw)N�METHOD_rrFT) r �globalsr:r=�OSError�errno�EINVAL�EPERM�ENOSYS�len� total_sizer,�append)r r�argsr7r?�result�es r� _add_methodrN\s��� �T� !�D� !�F�"(�G�I�i�$��� �&�� (�D� �F���r�4��� �#�f�+��!2�!2�2����v��� �� �� �7�7�u�|�|�U�[�[�%�,�,�?� ?�� �� �s� A*�* B9�3;B4�3B4�4B9�SHA512r#��j�SHA256r"�?)�b�y�ar�BLOWFISHr��;�MD5�1��"�CRYPT�rr%)r�sys�_sysr<�ModuleNotFoundError�platform� ImportErrorrD�string�_string�warnings�randomr� _SystemRandom� collectionsr� _namedtuple� _deprecatedr� ascii_letters�digitsr(r&r r:r=r,rN�_vrHrrr�rps4��K��Y�� ���0�1�����X�g�.�� "� "�W�^�^� 3�d� :� ��o��5�k�)�%G�H�5�# �$�# �L $� ��$(��" �H�c�2�s�#� �H�c�2�r�"� �B��:�s�R�x��R�#�b�'�\�$�G� � � �E�3��2�� �G�T�1�b�!�� ��k�Y� �}�}����H�I�I��W�X�X� Y�s �C�%C6