jacobwb/hashover-next

email decrypt ?

rpeveri opened this issue · 2 comments

good afternoon,
I want to export all the mails that are in mysql of the people who commented and I can not see them because they appear encrypted or something similar.
The idea is to make a marketing campaign and this problem is not allowing me to do it.
I hope someone can help me.
Thanks for your help.

and on the other hand googlebot can index the content of the comments encrypted with base64 ?

da2x commented

The idea is to make a marketing campaign and this problem is not allowing me to do it.

Good. Neither the GDPR nor other international privacy regulations allow you do to it either. You can’t send people newsletters and junk unless they’ve expressly opted-in to receiving it.

Here’s the decryption function:

// Decrypt OpenSSL encrypted string
public function decrypt ($string, $keys)
{
// Return false if string or keys is empty
if (empty ($string) or empty ($keys)) {
return false;
}
// Initial key
$decryption_key = '';
// Split keys string into array
$keys = explode (',', $keys);
// Retrieve random key from array
foreach ($keys as $value) {
// Cast key to integer
$hash_key = (int)($value);
// Check if encryption hash key exists
if (isset ($this->encryptionHash[$hash_key])) {
// If so, add character to decryption key
$decryption_key .= $this->encryptionHash[$hash_key];
} else {
// If not, give up and return false
return false;
}
}
// Decode base64 encoded string
$decoded = base64_decode ($string, true);
// Get length of decoded string
$length = mb_strlen ($decoded, '8bit');
// Get decipher text from decoded string
$decrypted = mb_substr ($decoded, $this->ivSize, $length, '8bit');
// Setup OpenSSL IV
$iv = mb_substr ($decoded, 0, $this->ivSize, '8bit');
// Return OpenSSL decrypted string
return openssl_decrypt (
// String being decrypted
$decrypted,
// Encryption decipher method
$this->cipher,
// Retrieved decryption key
$decryption_key,
// OpenSSL options
$this->options,
// Initialization vector
$iv
);
}