Encrypt editorial metadata for authors, sections, and tags
Marfeel supports encrypted Authors, Sections, and Tags for situations where you need to track editorial metadata without publicly exposing the real values. When declared as encrypted, the actual values are only visible to Marfeel.
Declaring real authors, sections, and tags is a good recommendation from an SEO and E-E-A-T perspective. However, there are strategic situations where you do not want to openly expose these values but still want to track them in Marfeel.
How to encrypt values
Section titled “How to encrypt values”Publishers encrypt values using an asymmetric RSA cipher. Specifically, you encrypt your text using Public-Key Cryptography Standards (PKCS) with the Optimal Asymmetric Encryption Padding (OAEP) padding scheme, then transform the result into a base64 string. More info on PKCS#1.
Marfeel public RSA key
Section titled “Marfeel public RSA key”Encrypt the values with this public RSA key:
-----BEGIN PUBLIC KEY-----MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA3TXGyYwHoNN1erI/UKPDudVAQhSV+mguc0aYjMWXj6ck98gSP/8Kaum/etDqkkLFhE075T+PH4zkNUsAgT+ZhnzbCQQJKGSWQa5oJEuokX+tD+x2kyvnGZtJQboIDhBU1h3MEgQlkXZmbiBNm0gobX0Hw9CoZHk0NPbjSP19PQFMF0gvVJKLp24MFjSzsS6R27H0a88HmChy0fiO5ClrBDKCAek5d/ZA5tVzV7X1ERqGYTHY912vM9/M4GggdrJycZrvKq9ZZF6FiccQfEOoWBvMcPhYXEle+D+5rjepryvCsChXcouwCfI2gWTkjFrQhzPHoriUiQ485UEebbk2T+JC3hsT3uZl2PjnQb5l6PAG+M33FVai1hCp39YNny6X1a+vE3wW9K8g6mJO7B4s4Lx/Pa45Epmd4vajMqskKKWCXumg7Yoru+steI8M7jn39NJ+gmzpmaOR0NDrxDlZfK5zG5D0cL//wB9f1WnpkYBvxVKS2V/O02UQU9c/w9tls9uHFJWnIOSKLA81xSX1LdkcdVTa5SAPll/RsRiyAJAnYYiM95t/dmFEYAK9NPw43wbu8+7NiQLQYxwV8/mDhRZkLw35xc0YxTkwxZjBYah8AFWmYS3nXhe0O3WvIkH/h6TR5DZLh4omic8U4YRorGLFmRav31PCT0YZFg3P/o0CAwEAAQ==-----END PUBLIC KEY-----How encryption works
Section titled “How encryption works”Marfeel extracts all the information before ## as the data.
Cipher code examples
Section titled “Cipher code examples”Here is a cipher example in PHP:
public function encrypt(string $data): string{ $oOpenSSLAsymmetricKey = openssl_get_publickey($this->publicKey); if (openssl_public_encrypt($data, $encrypted, $oOpenSSLAsymmetricKey, OPENSSL_PKCS1_OAEP_PADDING)) { $data = base64_encode($encrypted); } else { throw new \Exception('Unable to encrypt data'); }
return $data;}Here is a cipher example in Node.js:
const NodeRSA = require('node-rsa');
const encrypt = async (data) => { const clientKey = new NodeRSA(RSA_PUBLIC_KEY); clientKey.setOptions({encryptionScheme: 'pkcs1_oaep'});
return clientKey.encrypt(data, 'base64');};Here is a cipher example in Python:
from cryptography.hazmat.primitives.asymmetric import padding, rsafrom cryptography.hazmat.primitives import serialization, hashesimport base64
def encrypt_rsa(public_key_pem: str, data: str) -> str: public_key = serialization.load_pem_public_key(public_key_pem.encode()) encrypted = public_key.encrypt( data.encode(), padding.OAEP( mgf=padding.MGF1(algorithm=hashes.SHA1()), algorithm=hashes.SHA1(), label=None ) )
return base64.b64encode(encrypted).decode()Encrypting authors
Section titled “Encrypting authors”Declaration
Section titled “Declaration”The mrf:authors meta tag accepts encrypted="true":
<meta property="mrf:authors" encrypted="true" content="AiqpEJ+VdfIm9dlXeRND6RD+IdMBF=" >Example
Section titled “Example”To encrypt an article with authors John Doe and Fred Doe:
Non-encrypted:
<meta property="mrf:authors" content="John Doe;Fred Doe">Encrypted:
<meta property="mrf:authors" encrypted="true" content="theOutputOfEncrypting(John Doe;Fred Doe##randomdata)">Encrypting sections
Section titled “Encrypting sections”Declaration
Section titled “Declaration”The mrf:sections meta tag accepts encrypted="true":
<meta property="mrf:sections" encrypted="true" content="AiqpEJ+VdfIm9dlXeRND6RD+IdMBF=" >Example
Section titled “Example”To encrypt an article with sections Politics and Economy:
Non-encrypted:
<meta property="mrf:sections" content="Politics;Economy">Encrypted:
<meta property="mrf:sections" encrypted="true" content="theOutputOfEncrypting(Politics;Economy##randomdata)">Encrypting tags
Section titled “Encrypting tags”Declaration
Section titled “Declaration”The mrf:tags meta tag accepts encrypted="true":
<meta property="mrf:tags" encrypted="true" content="AiqpEJ+VdfIm9dlXeRND6RD+IdMBF=" >Example
Section titled “Example”To encrypt an article with tags:
Non-encrypted:
<meta property="mrf:tags" content="tagGroup1:tag_name;tagGroup2:another_tag_name">Encrypted:
<meta property="mrf:tags" encrypted="true" content="theOutputOfEncrypting(tagGroup1:tag_name;tagGroup2:another_tag_name##randomdata)">Why would I encrypt editorial metadata in Marfeel?
Encrypting metadata lets you track real authors, sections, and tags in Marfeel without publicly exposing those values. The real values are only visible to Marfeel after decryption.
What encryption method does Marfeel use for metadata?
Marfeel uses asymmetric RSA encryption with PKCS#1 OAEP padding. Publishers encrypt values with Marfeel’s public RSA key and encode the result as a base64 string.
Why should I include random data after ## when encrypting?
Appending a different random value after ## ensures that the same author, section, or tag does not produce the same encrypted output across articles, preventing pattern-based reverse engineering.