One Hat Cyber Team
Your IP:
216.73.216.102
Server IP:
198.54.114.155
Server:
Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
5.6.40
Create File
|
Create Folder
Execute
Dir :
~
/
home
/
fluxyjvi
/
www
/
assets
/
images
/
Edit File:
Ecdsa.tar
Sha384.php 0000644 00000000624 15107501373 0006233 0 ustar 00 <?php declare(strict_types=1); namespace Lcobucci\JWT\Signer\Ecdsa; use Lcobucci\JWT\Signer\Ecdsa; use const OPENSSL_ALGO_SHA384; final class Sha384 extends Ecdsa { public function algorithmId(): string { return 'ES384'; } public function algorithm(): int { return OPENSSL_ALGO_SHA384; } public function keyLength(): int { return 96; } } SignatureConverter.php 0000644 00000002012 15107501373 0011103 0 ustar 00 <?php declare(strict_types=1); namespace Lcobucci\JWT\Signer\Ecdsa; /** * Manipulates the result of a ECDSA signature (points R and S) according to the * JWA specs. * * OpenSSL creates a signature using the ASN.1 format and, according the JWA specs, * the signature for JWTs must be the concatenated values of points R and S (in * big-endian octet order). * * @internal * * @see https://tools.ietf.org/html/rfc7518#page-9 * @see https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One */ interface SignatureConverter { /** * Converts the signature generated by OpenSSL into what JWA defines * * @throws ConversionFailed When there was an issue during the format conversion. */ public function fromAsn1(string $signature, int $length): string; /** * Converts the JWA signature into something OpenSSL understands * * @throws ConversionFailed When there was an issue during the format conversion. */ public function toAsn1(string $points, int $length): string; } Sha256.php 0000644 00000000624 15107501373 0006231 0 ustar 00 <?php declare(strict_types=1); namespace Lcobucci\JWT\Signer\Ecdsa; use Lcobucci\JWT\Signer\Ecdsa; use const OPENSSL_ALGO_SHA256; final class Sha256 extends Ecdsa { public function algorithmId(): string { return 'ES256'; } public function algorithm(): int { return OPENSSL_ALGO_SHA256; } public function keyLength(): int { return 64; } } Sha512.php 0000644 00000000625 15107501373 0006225 0 ustar 00 <?php declare(strict_types=1); namespace Lcobucci\JWT\Signer\Ecdsa; use Lcobucci\JWT\Signer\Ecdsa; use const OPENSSL_ALGO_SHA512; final class Sha512 extends Ecdsa { public function algorithmId(): string { return 'ES512'; } public function algorithm(): int { return OPENSSL_ALGO_SHA512; } public function keyLength(): int { return 132; } } ConversionFailed.php 0000644 00000001137 15107501373 0010513 0 ustar 00 <?php declare(strict_types=1); namespace Lcobucci\JWT\Signer\Ecdsa; use InvalidArgumentException; use Lcobucci\JWT\Exception; final class ConversionFailed extends InvalidArgumentException implements Exception { public static function invalidLength(): self { return new self('Invalid signature length.'); } public static function incorrectStartSequence(): self { return new self('Invalid data. Should start with a sequence.'); } public static function integerExpected(): self { return new self('Invalid data. Should contain an integer.'); } } MultibyteStringConverter.php 0000644 00000011130 15107501373 0012310 0 ustar 00 <?php declare(strict_types=1); /* * The MIT License (MIT) * * Copyright (c) 2014-2018 Spomky-Labs * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * * @link https://github.com/web-token/jwt-framework/blob/v1.2/src/Component/Core/Util/ECSignature.php */ namespace Lcobucci\JWT\Signer\Ecdsa; use function assert; use function bin2hex; use function dechex; use function hex2bin; use function hexdec; use function is_string; use function mb_strlen; use function mb_substr; use function str_pad; use const STR_PAD_LEFT; /** * ECDSA signature converter using ext-mbstring * * @internal */ final class MultibyteStringConverter implements SignatureConverter { private const ASN1_SEQUENCE = '30'; private const ASN1_INTEGER = '02'; private const ASN1_MAX_SINGLE_BYTE = 128; private const ASN1_LENGTH_2BYTES = '81'; private const ASN1_BIG_INTEGER_LIMIT = '7f'; private const ASN1_NEGATIVE_INTEGER = '00'; private const BYTE_SIZE = 2; public function toAsn1(string $points, int $length): string { $points = bin2hex($points); if (self::octetLength($points) !== $length) { throw ConversionFailed::invalidLength(); } $pointR = self::preparePositiveInteger(mb_substr($points, 0, $length, '8bit')); $pointS = self::preparePositiveInteger(mb_substr($points, $length, null, '8bit')); $lengthR = self::octetLength($pointR); $lengthS = self::octetLength($pointS); $totalLength = $lengthR + $lengthS + self::BYTE_SIZE + self::BYTE_SIZE; $lengthPrefix = $totalLength > self::ASN1_MAX_SINGLE_BYTE ? self::ASN1_LENGTH_2BYTES : ''; $asn1 = hex2bin( self::ASN1_SEQUENCE . $lengthPrefix . dechex($totalLength) . self::ASN1_INTEGER . dechex($lengthR) . $pointR . self::ASN1_INTEGER . dechex($lengthS) . $pointS ); assert(is_string($asn1)); return $asn1; } private static function octetLength(string $data): int { return (int) (mb_strlen($data, '8bit') / self::BYTE_SIZE); } private static function preparePositiveInteger(string $data): string { if (mb_substr($data, 0, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT) { return self::ASN1_NEGATIVE_INTEGER . $data; } while ( mb_substr($data, 0, self::BYTE_SIZE, '8bit') === self::ASN1_NEGATIVE_INTEGER && mb_substr($data, 2, self::BYTE_SIZE, '8bit') <= self::ASN1_BIG_INTEGER_LIMIT ) { $data = mb_substr($data, 2, null, '8bit'); } return $data; } public function fromAsn1(string $signature, int $length): string { $message = bin2hex($signature); $position = 0; if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_SEQUENCE) { throw ConversionFailed::incorrectStartSequence(); } // @phpstan-ignore-next-line if (self::readAsn1Content($message, $position, self::BYTE_SIZE) === self::ASN1_LENGTH_2BYTES) { $position += self::BYTE_SIZE; } $pointR = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); $pointS = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); $points = hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT) . str_pad($pointS, $length, '0', STR_PAD_LEFT)); assert(is_string($points)); return $points; } private static function readAsn1Content(string $message, int &$position, int $length): string { $content = mb_substr($message, $position, $length, '8bit'); $position += $length; return $content; } private static function readAsn1Integer(string $message, int &$position): string { if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_INTEGER) { throw ConversionFailed::integerExpected(); } $length = (int) hexdec(self::readAsn1Content($message, $position, self::BYTE_SIZE)); return self::readAsn1Content($message, $position, $length * self::BYTE_SIZE); } private static function retrievePositiveInteger(string $data): string { while ( mb_substr($data, 0, self::BYTE_SIZE, '8bit') === self::ASN1_NEGATIVE_INTEGER && mb_substr($data, 2, self::BYTE_SIZE, '8bit') > self::ASN1_BIG_INTEGER_LIMIT ) { $data = mb_substr($data, 2, null, '8bit'); } return $data; } }
Simpan