SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > pinterest-for-woocommerce > src > >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/pinterest-for-woocommerce/src//

NameTypeSizeLast ModifiedActions
API Directory - -
Admin Directory - -
Exception Directory - -
MultichannelMarketing Directory - -
Notes Directory - -
Product Directory - -
Tracking Directory - -
Utilities Directory - -
View Directory - -
AdCredits.php File 8406 bytes August 26 2024 16:35:44.
AdCreditsCoupons.php File 1461 bytes August 26 2024 16:35:44.
AdsCreditCurrency.php File 1946 bytes May 20 2025 15:25:46.
Billing.php File 4901 bytes August 26 2024 16:35:44.
CommerceIntegration.php File 7185 bytes December 04 2024 18:47:06.
Compat.php File 952 bytes November 16 2021 18:14:38.
Crypto.php File 3718 bytes June 23 2025 21:16:30.
FeedFileOperations.php File 4680 bytes August 26 2024 16:35:44.
FeedGenerator.php File 22733 bytes August 26 2024 16:35:44.
FeedRegistration.php File 7230 bytes December 04 2024 18:47:06.
FeedStatusService.php File 20815 bytes March 18 2025 17:31:36.
Feeds.php File 13838 bytes December 04 2024 18:47:06.
Heartbeat.php File 1882 bytes October 23 2024 17:23:10.
LocalFeedConfigs.php File 3327 bytes September 24 2024 11:32:30.
LocaleMapper.php File 3167 bytes March 18 2025 17:31:36.
Logger.php File 3132 bytes August 26 2024 16:35:44.
Merchants.php File 6575 bytes September 24 2024 11:32:30.
PinterestApiException.php File 2767 bytes December 04 2024 18:47:06.
PinterestShippingZone.php File 7161 bytes February 16 2022 03:57:48.
PinterestSyncSettings.php File 3016 bytes August 26 2024 16:35:44.
PluginActivate.php File 785 bytes June 18 2022 00:23:22.
PluginHelper.php File 2537 bytes October 11 2022 17:51:18.
PluginUpdate.php File 11166 bytes May 29 2025 17:27:42.
ProductFeedStatus.php File 4453 bytes August 26 2024 16:35:44.
ProductSync.php File 6351 bytes September 24 2024 11:32:30.
ProductsXmlFeed.php File 17527 bytes February 11 2025 16:39:50.
RefreshToken.php File 3769 bytes August 26 2024 16:35:44.
RichPins.php File 9177 bytes August 26 2024 16:35:44.
SaveToPinterest.php File 3525 bytes April 26 2023 13:47:12.
Shipping.php File 8372 bytes February 16 2022 03:57:48.
TrackerSnapshot.php File 2574 bytes August 26 2024 16:35:44.
Tracking.php File 7488 bytes August 29 2024 22:54:16.
WPConsentAPI.php File 1178 bytes June 16 2025 21:44:24.
error_log File 260 bytes June 23 2025 21:16:32.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/pinterest-for-woocommerce/src///Crypto.php

<?php
/**
 * Pinterest for WooCommerce Crypto Wrapper
 *
 * @class       WP_Salesforce_Crypto
 * @version     1.0.0
 * @package     Pinterest_For_WooCommerce/Classes/
 */

namespace Automattic\WooCommerce\Pinterest;

use Defuse\Crypto\KeyProtectedByPassword;
use Defuse\Crypto\Crypto as DefuseCrypto;
use Defuse\Crypto\Key;
use Defuse\Crypto\Exception as DefuseException;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class handling encryption and decryption of sensitive data.
 */
class Crypto {

	/**
	 * The key used in place of a password for the encryption.
	 *
	 * @var string
	 */
	private static $key;

	/**
	 * Initiate class.
	 */
	public function __construct() {
		self::$key = \PINTEREST_FOR_WOOCOMMERCE_PREFIX . '_' . md5( is_multisite() ? \AUTH_KEY . get_current_blog_id() : \AUTH_KEY );
	}


	/**
	 * Create the Protected encoded key.
	 *
	 * @return mixed
	 */
	private static function create_key() {

		$protected_key         = KeyProtectedByPassword::createRandomPasswordProtectedKey( self::$key );
		$protected_key_encoded = $protected_key->saveToAsciiSafeString();

		if ( ! empty( $protected_key_encoded ) ) {
			Pinterest_For_Woocommerce()::save_data( 'crypto_encoded_key', $protected_key_encoded );
			return $protected_key_encoded;
		}

		return false;

	}


	/**
	 * Get the encoded user key.
	 *
	 * @param string $retry The retry attempt #.
	 */
	private static function get_key( $retry = null ) {

		static $user_key_encoded;

		if ( ! is_null( $user_key_encoded ) ) {
			return $user_key_encoded;
		}

		if ( empty( self::$key ) ) {
			new self();
		}

		$protected_key_encoded = Pinterest_For_Woocommerce()::get_data( 'crypto_encoded_key' );

		if ( empty( $protected_key_encoded ) ) {
			$protected_key_encoded = self::create_key();
		}

		try {
			$protected_key    = KeyProtectedByPassword::loadFromAsciiSafeString( $protected_key_encoded );
			$user_key         = $protected_key->unlockKey( self::$key );
			$user_key_encoded = $user_key->saveToAsciiSafeString();
		} catch ( DefuseException\WrongKeyOrModifiedCiphertextException | DefuseException\BadFormatException $ex ) {

			if ( is_null( $retry ) ) {
				Pinterest_For_Woocommerce()::save_data( 'crypto_encoded_key', null );
				return self::get_key( 1 );
			}

			Logger::log( esc_html__( 'Could not decrypt key value. Try reconnecting to Pinterest.', 'pinterest-for-woocommerce' ), 'error' );
			Pinterest_For_Woocommerce()::save_data( 'crypto_encoded_key', false ); // Reset base key.
			return false;
		}

		return $user_key_encoded;
	}


	/**
	 * Encrypt the given value and return the encrypted data.
	 *
	 * @param string $value the value to encrypt.
	 *
	 * @return string
	 */
	public static function encrypt( $value ) {

		$user_key_encoded = self::get_key();
		$user_key         = Key::loadFromAsciiSafeString( $user_key_encoded );

		return DefuseCrypto::encrypt( $value, $user_key );
	}


	/**
	 * Decrypt the given value and return the unencrypted data.
	 *
	 * @param string $encrypted_value the value to decrypt.
	 *
	 * @return string
	 */
	public static function decrypt( $encrypted_value ) {

		$user_key_encoded = self::get_key();
		$user_key         = Key::loadFromAsciiSafeString( $user_key_encoded );
		$value            = false;

		try {
			$value = DefuseCrypto::decrypt( $encrypted_value, $user_key );
		} catch ( DefuseException\WrongKeyOrModifiedCiphertextException $ex ) {
			// Either there's a bug in our code, we're trying to decrypt with the
			// wrong key, or the encrypted credit card number was corrupted in the
			// database.
			Logger::log( esc_html__( 'Could not decrypt key value. Try reconnecting to Pinterest.', 'pinterest-for-woocommerce' ), 'error' );
		}

		return $value;
	}
}

SILENT KILLER Tool