| Server IP : 217.160.0.135 / Your IP : 216.73.217.25 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/Protocol/__pycache__/ |
Upload File : |
�
8�tc�M � �2 � d dl Z d dlZd dlmZ d dlmZmZmZmZm Z m
Z
mZ d dlm
Z
mZmZmZmZ d dlmZ d dlmZ d dlmZmZmZ d dlmZmZmZmZ ed d
� � Z edd� � Z!dd�Z"dd�Z# G d� de$� � Z%dd�Z&dd�Z'd� Z(d� Z)d� Z*dd�Z+d� Z,dS ) � N)�reduce)�tobytes�bord�_copy_bytes�
iter_range�tostr�bchr�bstr)�SHA1�SHA256�HMAC�CMAC�BLAKE2s)�strxor)�get_random_bytes)�size�
long_to_bytes�
bytes_to_long)�load_pycryptodome_raw_lib�create_string_buffer�get_raw_buffer�c_size_tzCryptodome.Cipher._Salsa20z�
int Salsa20_8_core(const uint8_t *x, const uint8_t *y,
uint8_t *out);
zCryptodome.Protocol._scrypta
typedef int (core_t)(const uint8_t [64], const uint8_t [64], uint8_t [64]);
int scryptROMix(const uint8_t *data_in, uint8_t *data_out,
size_t data_len, unsigned N, core_t *core);
�� c � � |st }t | � � } |� | |z � � }|j }||k rt d|z � � �t |� � dk rt
dt |� � z � � �t |dz
� � D ])}|� |� � � � � }�*|� � � d|� S )aY Derive one key from a password (or passphrase).
This function performs key derivation according to an old version of
the PKCS#5 standard (v1.5) or `RFC2898
<https://www.ietf.org/rfc/rfc2898.txt>`_.
Args:
password (string):
The secret password to generate the key from.
salt (byte string):
An 8 byte string to use for better protection from dictionary attacks.
This value does not need to be kept secret, but it should be randomly
chosen for each derivation.
dkLen (integer):
The length of the desired key. The default is 16 bytes, suitable for
instance for :mod:`Cryptodome.Cipher.AES`.
count (integer):
The number of iterations to carry out. The recommendation is 1000 or
more.
hashAlgo (module):
The hash algorithm to use, as a module or an object from the :mod:`Cryptodome.Hash` package.
The digest length must be no shorter than ``dkLen``.
The default algorithm is :mod:`Cryptodome.Hash.SHA1`.
Return:
A byte string of length ``dkLen`` that can be used as key.
z:Selected hash algorithm has a too short digest (%d bytes).� z,Salt is not 8 bytes long (%d bytes instead).� N) r r �new�digest_size� TypeError�len�
ValueErrorr �digest)�password�salt�dkLen�count�hashAlgo�pHashr"