403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.37
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/Cryptodome/IO/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/Cryptodome/IO/__pycache__/PKCS8.cpython-311.pyc
�

8�tc"��V�ddlTddlmZmZmZmZddlmZmZm	Z	ddgZ
		d	d�Zd
d�ZdS)�)�*)�DerNull�DerSequence�DerObjectId�DerOctetString)�PBES1�PBES2�	PbesError�wrap�unwrapNc�@�|�t��}tdtt|��|g��t|��g��}|���}|�|S|std���t
|��}|�d}tj|||||��S)a�
Wrap a private key into a PKCS#8 blob (clear or encrypted).

    Args:

      private_key (byte string):
        The private key encoded in binary form. The actual encoding is
        algorithm specific. In most cases, it is DER.

      key_oid (string):
        The object identifier (OID) of the private key to wrap.
        It is a dotted string, like ``1.2.840.113549.1.1.1`` (for RSA keys).

      passphrase (bytes string or string):
        The secret passphrase from which the wrapping key is derived.
        Set it only if encryption is required.

      protection (string):
        The identifier of the algorithm to use for securely wrapping the key.
        The default value is ``PBKDF2WithHMAC-SHA1AndDES-EDE3-CBC``.

      prot_params (dictionary):
        Parameters for the protection algorithm.

        +------------------+-----------------------------------------------+
        | Key              | Description                                   |
        +==================+===============================================+
        | iteration_count  | The KDF algorithm is repeated several times to|
        |                  | slow down brute force attacks on passwords    |
        |                  | (called *N* or CPU/memory cost in scrypt).    |
        |                  | The default value for PBKDF2 is 1000.         |
        |                  | The default value for scrypt is 16384.        |
        +------------------+-----------------------------------------------+
        | salt_size        | Salt is used to thwart dictionary and rainbow |
        |                  | attacks on passwords. The default value is 8  |
        |                  | bytes.                                        |
        +------------------+-----------------------------------------------+
        | block_size       | *(scrypt only)* Memory-cost (r). The default  |
        |                  | value is 8.                                   |
        +------------------+-----------------------------------------------+
        | parallelization  | *(scrypt only)* CPU-cost (p). The default     |
        |                  | value is 1.                                   |
        +------------------+-----------------------------------------------+

      key_params (DER object):
        The algorithm parameters associated to the private key.
        It is required for algorithms like DSA, but not for others like RSA.

      randfunc (callable):
        Random number generation function; it should accept a single integer
        N and return a string of random data, N bytes long.
        If not specified, a new RNG will be instantiated
        from :mod:`Cryptodome.Random`.

    Return:
      The PKCS#8-wrapped private key (possibly encrypted), as a byte string.
    NrzEmpty passphrasez"PBKDF2WithHMAC-SHA1AndDES-EDE3-CBC)	rrrr�encode�
ValueError�tobytesr	�encrypt)	�private_key�key_oid�
passphrase�
protection�prot_params�
key_params�randfunc�pk_info�pk_info_ders	         �5/usr/lib/python3/dist-packages/Cryptodome/IO/PKCS8.pyrr2s���v���Y�Y�
������(�(������{�+�+�
���G��.�.�"�"�K������-��+�,�,�,���$�$�J���9�
��=��j�#�[�(�<�<�<�c��|r�t|��}d}	tj||��}d}n6#t$r}dt	|��z}Yd}~nd}~wt
$rd}YnwxYw|sU	t
j||��}d}n<#t$r}|dt	|��zz
}Yd}~nd}~wt
$r|dz
}YnwxYw|std|z���t���|d	�
��}t|��dkr|std���|d
d
krtd���t���|dd�
��}t���|d
��j}t|��dkrd}n:	t���|d��d}n#|d}YnxYwt���|d��j}	||	|fS)aHUnwrap a private key from a PKCS#8 blob (clear or encrypted).

    Args:
      p8_private_key (byte string):
        The private key wrapped into a PKCS#8 blob, DER encoded.
      passphrase (byte string or string):
        The passphrase to use to decrypt the blob (if it is encrypted).

    Return:
      A tuple containing

       #. the algorithm identifier of the wrapped key (OID, dotted string)
       #. the private key (byte string, DER encoded)
       #. the associated parameters (byte string, DER encoded) or ``None``

    Raises:
      ValueError : if decoding fails
    FTz	PBES1[%s]NzPBES1[Invalid]z
,PBES2[%s]z,PBES2[Invalid]zError decoding PKCS#8 (%s))���)�nr_elementsrz;Not a valid clear PKCS#8 structure (maybe it is encrypted?)rz#Not a valid PrivateKeyInfo SEQUENCE�)r"r)rr�decryptr
�strrr	r�decode�lenr�valuerr�payload)
�p8_private_keyr�found�e�	error_strr�algo�algo_oid�algo_paramsrs
          rrr�s_��(�G��Z�(�(�
���	)�"�]�>�:�F�F�N��E�E���	-�	-�	-�#�c�!�f�f�,�I�I�I�I�I�I������	)�	)�	)�(�I�I�I�	)�����	/�
/�!&��~�z�!J�!J�������
3�
3�
3��\�C��F�F�2�2�	�	�	�	�	�	������
/�
/�
/��.�.�	�	�	�
/�����	G��9�I�E�F�F�F��m�m�"�"�>�y�"�I�I�G�
�7�|�|�q������4�5�5�	5��q�z�Q����>�?�?�?��=�=�����
���?�?�D��}�}�#�#�D��G�,�,�2�H�
�4�y�y�A�~�~����	"��I�I���T�!�W�%�%�%��K�K��	"��q�'�K�K�K����!�"�"�)�)�'�!�*�5�5�=�K��k�;�/�/sD�-�
A �A�A �A �&A>�>
B7�B"�"B7�6B7�)G�
G)NNNNN)N)
�Cryptodome.Util.py3compat�Cryptodome.Util.asn1rrrr�Cryptodome.IO._PBESrr	r
�__all__rr�rr�<module>r5s���F(�'�'�'�������������8�7�7�7�7�7�7�7�7�7��8�
��<@�59�[<�[<�[<�[<�|W0�W0�W0�W0�W0�W0r

Youez - 2016 - github.com/yon3zu
LinuXploit