Try with the below code in your block and let me know.
<?php
namespace Vendor\ModuleName\Block;
class TestClassName extends \Magento\Framework\View\Element\Template
{
const XML_PATH_ENABLED_FRONTEND = 'msp_securitysuite_recaptcha/frontend/enabled';
const XML_PATH_PUBLIC_KEY = 'msp_securitysuite_recaptcha/general/public_key';
/**
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
*/
public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
) {
$this->scopeConfig = $scopeConfig;
}
public function getFrontendCaptchaEnabled()
{
return $this->scopeConfig->getValue(
self::XML_PATH_ENABLED_FRONTEND,
ScopeInterface::SCOPE_STORE
);
}
public function getSecurityCaptchaKey()
{
return $this->scopeConfig->getValue(
self::XML_PATH_PUBLIC_KEY,
ScopeInterface::SCOPE_STORE
);
}
}
if you would like to call the above method in your template file use this syntax
$block->getSecurityCaptchaKey();